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 Snapshot Version Header #2853
Comments
@cpojer You mean everytime snapshot updates.increment new version? |
@anilreddykatta no, it's a version that we define in jest-snapshot, like:
does that make sense? |
@cpojer Yeah makes sense..so when we update snapshots next time..will the version number change? |
Yes. This is just to let you know, that there's a change in snapshot formatting, which you should just update, because it breaks your tests |
@thymikee Thanks 👍 |
can we add something like
Instead of a comment? (as it's easier to get it for checks later) |
What about naming collision, when someone names the snapshot the same way? |
I think a comment is way more correct for this use case.
…________________________________
From: Michał Pierzchała <notifications@github.com>
Sent: Friday, February 10, 2017 6:20:32 PM
To: facebook/jest
Cc: Christoph Pojer; Mention
Subject: Re: [facebook/jest] Jest Snapshot Version Header (#2853)
What about naming collision, when someone names the snapshot the same way?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2853 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAA0KAJACWu5BsHNvPbHRfhiM8ZUZYT9ks5rbKpwgaJpZM4L8fDc>.
|
Maybe for first version we should not throw an error? We could just save the information about the version 1 in Jest 19 and error on future changes, what do you think? |
It should definitely throw an error in the first version. If Jest doesn't detect this header, throw -> it means you are pre Jest 19 and the snapshot must be updated. |
BTW, I'll be working on this tomorrow, but if anyone has time to deal with it today, don't hesitate! |
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. |
We discussed adding a header like:
and then validate Jest and throw if the snapshot version doesn't match, like:
The text was updated successfully, but these errors were encountered: