oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.55k stars 2.71k forks source link

Test runner in VS Code extension #4824

Open ffMathy opened 1 year ago

ffMathy commented 1 year ago

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

alfu32 commented 1 year ago

maybe configure jest extension to run with bun

ffMathy commented 1 year ago

That's what #4562 proposes.

Electroid commented 1 year ago

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

ffMathy commented 1 year ago

@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.

Electroid commented 1 year ago

@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.

orbiteleven commented 1 year ago

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

ssalbdivad commented 1 year ago

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.

Kleywalker commented 10 months ago

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

ffMathy commented 8 months ago

@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?

kingkong404 commented 6 months ago

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?)

drk-mtr commented 5 months ago

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.

ffMathy commented 4 months ago

@drk-mtr great work and discovery. I mean, even tests without coverage could be a fine start with a known limitation. Could you create a PR for this?

drk-mtr commented 4 months ago

Thanks but unfortunately the code I was playing with does nothing useful. It finds tests but it can't run them or report on the results.

Kleywalker commented 3 months ago

Are there any updates yet? Is anyone working on this? As projects getting larger running und debugging individual tests are not convenient but necessary. Keyboard shortcuts would speed up development a lot.

ffMathy commented 2 months ago

@Kleywalker doesn't look like it's being worked on. It's also not on Bun's updated roadmap 😦

MaxMoldmann commented 2 months ago

I would suggest that this single issue is one of the major user adoption hurdles. This needs a high priority.

ffMathy commented 2 months ago

I agree. Any official comment from the Bun team would be nice. I won't adopt Bun before this is ready.

ducan-ne commented 1 month ago

Looking forward for this 👀

ffMathy commented 1 month ago

Remember to give it a thumbs up reaction in the main post (not as a comment). I think that's how they prioritize.

boehs commented 19 hours ago

https://github.com/oven-sh/bun/pull/13668