bun icon indicating copy to clipboard operation
bun copied to clipboard

Test runner in VS Code extension

Open ffMathy opened this issue 1 year ago • 17 comments

What is the problem this feature would solve?

Bun tests can only be run from the CLI.

What is the feature you are proposing to solve the problem?

A VS Code extension could integrate the tests with the test explorer.

What alternatives have you considered?

No response

ffMathy avatar Sep 10 '23 15:09 ffMathy

maybe configure jest extension to run with bun

alfu32 avatar Sep 11 '23 10:09 alfu32

That's what #4562 proposes.

ffMathy avatar Sep 11 '23 20:09 ffMathy

We are working on a VSCode extension and it will have test runner support.

Electroid avatar Sep 11 '23 21:09 Electroid

@Electroid great. Is there a way to track its progress somehow? Is the work being done on a particular branch?

And is it possible to provide some sort of ETA on when we can expect this? Eagerly waiting. Bun is awesome.

ffMathy avatar Sep 12 '23 05:09 ffMathy

@Electroid great. Is there a way to track its progress somehow? Is the work being done on a particular branch?

And is it possible to provide some sort of ETA on when we can expect this? Eagerly waiting. Bun is awesome.

You can test it out here. Note that it does not have test support yet, but you can use the debugger. The code for the extension is in the packages/bun-vscode directory.

Electroid avatar Sep 12 '23 05:09 Electroid

@Electroid is there an issue tracking test support yet? Or is this the issue?

orbiteleven avatar Sep 29 '23 10:09 orbiteleven

This would be a big deal for me in terms of adoption.

I tried bun out after updating some node dependencies and running into another ESM/CJS issue but would hate to give up the really clean test-runner integration.

ssalbdivad avatar Oct 05 '23 20:10 ssalbdivad

Is there a roadmap? Using test runner would increase productivity immensely! Especially run test at cursor and rerun previous test including keyboard shortcuts!

Kleywalker avatar Dec 05 '23 21:12 Kleywalker

@Jarred-Sumner just one quick word on an ETA or if this is a priority in 2024? I don't see it on the roadmap. Is this intentional?

ffMathy avatar Jan 28 '24 19:01 ffMathy

Is there anyway to achieve this functionality with the release of Bun 1.1 now that it has additional test framework support? (reconfigure any of the current vscode test runner plugins to use bun?)

kingkong404 avatar Apr 06 '24 12:04 kingkong404

This would be a great addition.

Is there anyway to achieve this functionality with the release of Bun 1.1 now that it has additional test framework support? (reconfigure any of the current vscode test runner plugins to use bun?)

Getting the node:test runner library to discover tests is a two line change, but I wouldn't know how to integrate the reporting aspect.

buntest

I wonder whether this could be done in two stages: for now, use this discovery to run a command in the terminal, then add proper integration with the Testing API UI later. Though I guess this isn't a big step up from using the existing Bun: Run File functionality.

drk-mtr avatar May 05 '24 10:05 drk-mtr