Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new test files aren't picked up by extension #489

Closed
4 tasks done
opeologist opened this issue Oct 7, 2024 · 3 comments
Closed
4 tasks done

new test files aren't picked up by extension #489

opeologist opened this issue Oct 7, 2024 · 3 comments
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@opeologist
Copy link

Describe the bug

when i create a new test file in a repo using vitest, i always have to restart VSCode in order for the extension to pick up the test file and the associated tests within it. would be nice to either have it automatically pick the file up, or, like the typescript server, have a command you can run from cmd+shift+p to restart the extension to pick the new file up. would just like to not have to restart the app if possible.

Reproduction

create a new test file with a test in it and save. in order for the extension play button to show up in the file, you have to restart VSCode

Output

[INFO 8:20:50 AM] [v1.2.19] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 8:20:50 AM] [API] Running Vitest v1.6.0 (app/vitest.config.ts) with Node.js@v20.17.0: /Users/user/.nvm/versions/node/v20.17.0/bin/node 
[INFO 8:20:50 AM] [API] Vitest v1.6.0 (app/vitest.config.ts) process 40790 created
[8:20:50 AM] [VSCODE] File deleted: vitest.config.ts.timestamp-1728307250648-8736135778afb.mjs
[8:20:53 AM] [VSCODE] File deleted: .git/index.lock
[8:25:59 AM] [VSCODE] File created: src/components/Foo/Foo.test.tsx
[INFO 8:25:59 AM] [Worker] Collecting tests due to file changes: src/components/Foo/Foo.test.tsx
[8:26:00 AM] Not starting the runner because tests are being collected
[8:26:00 AM] No test run to finish for 
[8:26:00 AM] [VSCODE] File changed: node_modules/.vite/vitest/results.json
[8:26:43 AM] [VSCODE] File changed: src/components/Foo/Foo.test.tsx
[INFO 8:26:43 AM] [Worker] Collecting tests due to file changes: src/components/Foo/Foo.test.tsx
[8:26:43 AM] Not starting the runner because tests are being collected
[8:26:43 AM] No test run to finish for 
[8:26:43 AM] [VSCODE] File changed: node_modules/.vite/vitest/results.json

Version

v1.2.19

Validations

@sheremet-va sheremet-va added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Oct 7, 2024
@sheremet-va
Copy link
Member

You don't need to restart the extension, you can press "Refresh Tests" button
Screenshot 2024-10-07 at 15 33 32

@opeologist
Copy link
Author

nice! ty for that, and now that i know it's called "Refresh Tests" i found the global command for it as well! thanks, closing!

@sheremet-va
Copy link
Member

This was an issue with how the extension worked in Vitest 1+. It should be fixed in 1.2.20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

2 participants