-
-
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
Change snapshot header for Jest mocks to MockFunction #4835
Comments
* Print jest mock fuctions as `MockFunction` in jest-snapshot Fixes #4835 * less string concat
@mjesun which version did this change first go in, please? Many thanks in advance! |
@JustJelena in Jest 22, look for #4668 in the changelog. The change discussed in this issue landed between alphas, so conceptually it's part of #4668 |
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. |
Do you want to request a feature or report a bug?
That's gonna be a feature.
What is the current behavior?
Snapshots containing mocks are serialized as
Object
withcalls
+name
. While this is correct, an object with an equivalent structure could make the snapshot pass (see #4829). For instance:Would make the test pass, despite this is not a
jest.fn()
.What is the expected behavior?
We will change the header signature from
Object
toMockFunction
, which will make impossible to accidentally match with an object.The text was updated successfully, but these errors were encountered: