bun
bun copied to clipboard
feat(vscode-extension): test support
What does this PR do?
Bun Vscode extension test support It is a little bit inspired by rust vs code extension, where the user can run tests directly in the editor.
I created this functionality a few weeks ago and found it helpful in my projects, so maybe it can be added to the extension, or maybe not :D
-
ability to run test directly from vscode opened editor:
-
run test for whole file via vscode settings command:
-
user defined test file pattern matcher:
-
[x] Documentation or TypeScript types (it's okay to leave the rest blank in this case)
-
[x] Code changes
Code changes
- added new test provider packages/bun-vscode/src/features/tests/index.ts - handling run (watch) test command + code lens
- code-lens - add
run test
watch test
buttons for each test in currently opened file - update vscode extension package.json to support
run test
andwatch test
for the current open file - update vscode extension package.json to support new
bun.test.filePattern
extension setting (pattern for matching the test files)
How did you verify your code works?
Unfortunately, there is no test method in bun vs-code extension code base. So just manually :(