vscode-jest icon indicating copy to clipboard operation
vscode-jest copied to clipboard

Support for Bun

Open ffMathy opened this issue 1 year ago • 4 comments

I think it would be great if this extension had support for Bun's test runner.

ffMathy avatar Sep 10 '23 09:09 ffMathy

I had hoped that setting jestCommandLine to bun test or bun test -- would work, but it doesn't :-(

larsw avatar Sep 14 '23 13:09 larsw

do you have a sample repo we can try? what was the error you are seeing?

connectdotz avatar Sep 14 '23 16:09 connectdotz

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.

  1. 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.
  2. We wait until Bun fixes the above linked issue.
  3. Someone makes a CLI wrapper that translates a Jest commandline into a Bun commandline. So something that acts as an adapter.
  4. We wait until Bun implements their own test runner extension. This has been confirmed by them, but no ETA has been given.

ffMathy avatar Sep 14 '23 18:09 ffMathy

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.

connectdotz avatar Sep 14 '23 19:09 connectdotz