callstack / reassure

Performance testing companion for React and React Native
https://callstack.github.io/reassure/
MIT License
1.25k stars 27 forks source link

[FEATURE] Bun support #452

Open robertherber opened 7 months ago

robertherber commented 7 months ago

I'm trying to get a test suite running with Bun, but it seems to use node and jest no matter what I do. Feels like the wiring is under the hood and not configurable. It would be great to be able to run Reassure with Bun :)

mdjastrzebski commented 7 months ago

I do not have too much knowledge about bun.

I've got some questions we could start with:

robertherber commented 7 months ago

I only know the answer to the first question - bun test :)

Expo for example is fully supporting Bun with all its tools now, and I get the feeling they're almost recommending it because of it's speed and reduced need for tooling.

Similarly to jest you can specify a test setup file, either with a --preload flag or in a bunfig.toml file.

Hopefully it's just a matter of being able to specify bun as the test runner instead of jest :)

Note that it supports TypeScript and ESM seamlessly, so that takes away a lot of complexity.

mdjastrzebski commented 3 months ago

This issue could/should be implemented in 2 phases:

V3RON commented 1 month ago

@mdjastrzebski I gave it a try—I created a Vite project powered by Bun, installed Reassure with Jest, and ran it without any issues.

However, at least two problems are stopping me from running Reassure in the Bun runtime: a) the test runner currently doesn't offer an option to customize test file patterns b) bun's runtime performance isn't highly customizable.

It's fairly easy to make the changes needed to run Reassure in the Bun test environment, but performance may vary (runtime optimizations).