-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Sometimes Vitest extension runs cached tests #512
Comments
I made a video showing the error: https://www.youtube.com/watch?v=eHspbQGqGE4 It happens when I rename the directories of my snapshot files. In my test cases I assemble paths using it('fixes imports from index files', async () => {
const projectDir = path.join(fixtures, 'index-import');
const projectConfig = path.join(projectDir, 'tsconfig.json');
const snapshot = path.join(projectDir, 'main.snap.ts');
const project = ProjectUtil.getProject(projectConfig);
const modifiedFile = convertFile(project, project.getSourceFile('main.ts')!, true);
await expect(modifiedFile.getText()).toMatchFileSnapshot(snapshot);
}); When I now rename a directory (i.e. |
Does it stop working after you rename a folder? Does it work before that? |
It stops working after I rename a folder (as shown in the video). Before renaming the folder, the extension works fine! |
Describe the bug
I've noticed that sometimes my tests fail when running them from the VS Code extension. In the screenshot below, you can see a mismatch between my actual test description ("fixes imports from index files") vs. what was run by the Vitest extension ("adds imports from barrel files", which was the previous test description). This indicates a caching problem.
Reproduction
For me this happens when I rename my test snapshot files.
Here is the testing code that I used:
Output
Version
v1.6.1
Validations
The text was updated successfully, but these errors were encountered: