vscode
vscode copied to clipboard
Always have to run tests twice when the main describe is not a string
Describe the bug
When a test has a main describe name that is not a string like describe(Service.name) it never run the tests the first time I hit the run button, I need to hit it twice.
The main problem is that with every change in the test code, I will need to hit the button twice too.
Reproduction
Link to repository with reproduction
Output
Incorrect first run
[INFO 12:40:02] Running 1 file(s) with name pattern: ^\s?Service\.name should be true$
[12:40:02] Starting a test run because test/service.test.ts triggered a watch rerun event
[12:40:02] Enqueuing "should be true"
[12:40:03] Ignore "service.test.ts" during collection
[12:40:03] Ignore "Service" during collection
[12:40:03] Marking "should be true" as skipped
[12:40:03] No errors found for "service.test.ts"
[12:40:03] No errors found for "service.test.ts"
[12:40:03] Ending test run test/service.test.ts
[12:40:03] Test run promise is finished, the queue is 0
[12:40:03] [VSCODE] Ignoring file: node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json
Correct second run
[INFO 12:40:33] Running 1 file(s) with name pattern: ^\s?Service should be true$
[12:40:33] Starting a test run because test/service.test.ts triggered a watch rerun event
[12:40:33] Enqueuing "should be true"
[12:40:33] No task result for "service.test.ts", ignoring
[12:40:33] No task result for "Service", ignoring
[12:40:33] Enqueuing "should be true" because it was just collected
[12:40:33] No errors found for "service.test.ts"
[12:40:33] No errors found for "Service"
[12:40:33] Marking "should be true" as passed
[12:40:33] No errors found for "service.test.ts"
[12:40:33] Ending test run test/service.test.ts
[12:40:33] Test run promise is finished, the queue is 0
[12:40:33] [VSCODE] Ignoring file: node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json
Extension Version
1.28.2
Vitest Version
3.2.4
Validations
- [x] Check that you are using the latest version of the extension
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [x] The provided reproduction is a minimal reproducible example of the bug.