vscode-jest
vscode-jest copied to clipboard
Support for Bun
I think it would be great if this extension had support for Bun's test runner.
I had hoped that setting jestCommandLine
to bun test
or bun test --
would work, but it doesn't :-(
do you have a sample repo we can try? what was the error you are seeing?
I think the issue is that the bun test CLI does not simulate the same arguments as jest CLI does.
The arguments are named differently etc.
I filed an issue here: https://github.com/oven-sh/bun/issues/4562
The way I see it, we have four options.
- We make this extension also support Bun. While enticing, it doesn't feel right, since Bun's test CLI technically shares nothing in similarity with Jest.
- We wait until Bun fixes the above linked issue.
- Someone makes a CLI wrapper that translates a Jest commandline into a Bun commandline. So something that acts as an adapter.
- We wait until Bun implements their own test runner extension. This has been confirmed by them, but no ETA has been given.
This extension does rely on some jest features, such as the --json
, --reporters
, --listTests
, and --coverage
, to name a few. Many of them didn't seem to be supported by Bun right now, so a simple adaptor is most likely not going to work...
It seems for this extension to support Bun, Bun would first need to reach feature parity in regard to these features. It might never happen, as @ffMathy said, Bun test is technically different from jest. In that case, I think it is best to use Bun's native extension instead.