vscode: Vitest extension doesn't rerun tests when test files change
Describe the bug
When test files change, Vitests extension doesn’t rerun them. The only way to rerun tests files and get new data is to click “Refresh tests” and then “Run tests” on every change inside test files. In terminal tests are rerunning normally on files save. I uploaded a short video
https://github.com/user-attachments/assets/17589783-8a98-4094-bc0a-a95d6b5a078e
Reproduction
Write any type of tests and run them
Output
.
Version
1.2.12 published 2024-09-30
Validations
- Check that you are using the latest version of the extension
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 13
- Comments: 31 (10 by maintainers)
Yes but I never observed the test run. No test results were shown and the test icon never changed to this yellow icon one normally gets when rerunning tests. I always have to wait around 4~ seconds after changing the file to trigger a test rerun.
We’ve had issues like this for ages. But I don’t want to report it because there’s no way I can make a repro, and so it’ll just be closed.
Our developers have to reload VS Code like 10 times a day.
We are in the process of trying to switch to another test extension, but others are unstable too. We hope switching to Deno 2.0 will help, or perhaps even Bun when they finish their extension.
I hope someone finds a root cause. I wonder how many are secretly having this issue.
Having the same problem here, too. Despite enabling Continuous Run, updating tests does not trigger a rerun. I’m on macOS.
Expected: test to re run when file changed, and reflect with pass or fail icons in the editor. What actually happened: No passing icons showed, or changed, not matter fixing the test or making it fail.
minimal repo: https://github.com/fazulk/vitest-watch-bug
vitest output:
@sheremet-va
Not having the same problem here!
Provide more info:
Percieved bug might be a different bug. Just adding “+1” does not help fix the issue. It is insane that people expect this issue to be fixed without providing any help.
I am unsubscribing from this thread and coming back in several weeks. No help = no fix, I am not a magician. If someone else wants to step in, be my guest.