Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bun test --coverage results in non-zero exit code when coverage falls below default level #4020

Closed
jakeboone02 opened this issue Aug 6, 2023 · 0 comments
Labels
bug Something isn't working bun:test Something related to the `bun test` runner

Comments

@jakeboone02
Copy link
Contributor

jakeboone02 commented Aug 6, 2023

What version of Bun is running?

0.7.3

What platform is your computer?

Darwin 22.6.0 x86_64 i386

What steps can reproduce the bug?

Run bun test --coverage in a project with no bunfig.toml and where the coverage is < 90%.

What is the expected behavior?

Without coverageThreshold explicitly configured by the user, --coverage should simply report coverage and not force a non-zero exit code. Non-zero exit codes should only appear for passing test suites if coverageThreshold is explicitly configured.

What do you see instead?

--coverage results in a non-zero exit code when coverage falls below coverageThreshold, even if it falls back to the default of 90%.

Additional information

The requested change is to match the behavior of Jest. (I haven't tried Vitest.)

  • Passing tests + no threshold configured + coverage < default = zero exit code.
  • Passing tests + threshold configured + coverage < threshold = non-zero exit code.
@jakeboone02 jakeboone02 added the bug Something isn't working label Aug 6, 2023
@Electroid Electroid added the bun:test Something related to the `bun test` runner label Aug 6, 2023
trnxdev pushed a commit to trnxdev/bun that referenced this issue Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun:test Something related to the `bun test` runner
Projects
None yet
Development

No branches or pull requests

2 participants