Before this PR, bun test would have a ton of failures if you ran it locally. We didn't see this in CI because our runners would test each file separately from one another.
After doing some digging, I found a couple of issues:
AFAICT, bun test maintains globals across modules (unlike jest), so you have to be careful to reset it.
Sometimes tests would hang because failures wouldn't call the done callback.
What does this PR do and why?
Before this PR,
bun test
would have a ton of failures if you ran it locally. We didn't see this in CI because our runners would test each file separately from one another.After doing some digging, I found a couple of issues:
bun test
maintains globals across modules (unlike jest), so you have to be careful to reset it.done
callback.And the various solutions:
await
/async
vs callbacks.Steps to validate locally
All of the following should succeed:
bun test
bun run test:dev
bun run test:prod