-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Jest detects linux .snap package file as obsolete snapshot #8922
Comments
Could you provide a minimal repro, so it's easier to investigate? |
The logic lives here: https://github.com/facebook/jest/blob/0935f7c2cd7780e47365511e35efc829ba359df4/packages/jest-snapshot/src/index.ts#L132-L133 Not sure how to handle it... #8665 added the logic that if the resolved test file is ignored, then we ignore the snap file. Maybe we can tweak it to cover your use-case as well? Thoughts? |
Thanks to both! I was trying to find the code which looked for the snap files, but I couldn't find it on my own. I'll give it a look and maybe I can think of a solution. Why don't just ignore snap files inside
|
I'm also running into this issue. Since I'm using CRA, I cannot add testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
], The file that is causing me headaches is in a Perhaps it can be ignored if not within the |
I just ran into this as well. I like @nahuelarjonadev's suggestion of ignoring snap files in Any chance that this can be implemented? |
Similar issue here, I got two types of test files (basically one unit, one much slower using storyshots) and as such I have a variable For example: TestA has a snapshot, TestB has a snapshot When running TestA and TestB at the same time, no issue. But if I change the What would fix it for me: when a .snap file is found, resolve it to the test file and only report it as obsolete if that test file has been run. If the test file hasn't been run, it's either not a Jest snapshot file or it's not supposed to be included in this test run. |
Similar issue -- Postgres creates What's needed: 1 -- ignore files named 2 -- respect the various path parameters ( 3 -- provide a big-hammer config option |
I found a workaround that works fine for my case by using custom |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
still an issue |
jest bug issue: jestjs/jest#8922
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
still an issue. |
Current behavior
when running Jest, it's detecting a .snap package I built for Linux as an obsolete snapshot, and it's causing my tests to fail. I tried ignoring the folder with no success.
Part of the test output:
package.json scripts:
Folder Structure
jest.config.js
Expected behavior
Being able to ignore the path to the release folder, so Jest doesn't try to parse any files inside it as a snapshot
envinfo
The text was updated successfully, but these errors were encountered: