Closed coolsoftwaretyler closed 7 months ago
I was able to get this working with a little bit of bash scripting. I don't love it, but since the Bun test runner doesn't behave precisely like jest -i
, someone recommended this command instead, which we can chain together to get full tests running with minimal skips and changes.
The major downside right now is that coverage is no longer correctly generated. I will see if I can fix that up.
Bun also shipped support for expect.assertions
, so I was able to keep that expectation in there
I added the specific toThrow
error messages back to those expectations, and then realized we weren't appropriately failing with the one-liner script to run all tests, so I put together separate bash scripts that will fail the process if we got any failures (and output the full results if so).
I also removed cross-env
for now since we were only using it in those test commands, and we've swapped to bash scripts which presume a specific type of environment variable setting.
What does this PR do and why?
This PR will convert our Jest test to bun test. This offers us a few advantages:
ts-jest
ts-jest
andjest
itself, we reduce ourdevDependencies
as wellMstError
from a rebaseSteps to validate locally
bun install
bun test:all
- tests should pass.time bun test:all
, you can measure its runtime. Here's what I got on my 2020 Macbook Pro with Intel i7/32 GB RAM:Compare this to the
yarn test:all
run inmaster
, which reports:Ran it with
time yarn test:all
and got slightly better results but with a lot more CPU usage: