-
-
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
toMatchSnapshot(filepath) #4231
Comments
Yeah, we cannot do this, precisely for the reason you mentioned about consistency between snapshot files and tests. If we had to apply static analysis to get this information, it would break down in a bunch of ways and make this really hard :( |
Something that might help: #4183 |
I'm happy not having unused snapshot files being removed automatically to be honest. |
Is there a way to observe if jest is running with |
Not currently. I don't think it's reasonable to deploy something at Facebook that doesn't clean up after itself. We'd have multiple thousand snapshot files at FB at this point if we didn't have the consistency check :( |
Hey, I've created this matcher that allows specifying snapshot location in the following way: expect(value).toMatchSpecificSnapshot('path/to/file.snapshot') Hope it will help. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The current jest snapshot tests are annoying in the context of jest (and I presume relay as well) because they put things inside of quotes and add some small wrapper code to make it parse as js and it generates those snapshots in some
__
directory.I've been thinking about this problem for a while and I think I finally have a solution: add the ability to specify the filename as an argument of
toMatchSnapshot()
.Current
Suggestion
Discussion
I'm not 100% sure how to remove unused snapshot files when they are no longer in use.
The text was updated successfully, but these errors were encountered: