You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usually `jest` tries to match every snapshot that is expected in a test.
298
+
299
+
Sometimes it might not make sense to continue the test if a prior snapshot failed. For example, when you make snapshots of a state-machine after various transitions you can abort the test once one transition produced the wrong state.
300
+
301
+
In that case you can implement a custom snapshot matcher that throws on the first mismatch instead of collecting every mismatch.
`expect.anything()` matches anything but `null` or `undefined`. You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value. For example, if you want to check that a mock function is called with a non-null argument:
Usually `jest` tries to match every snapshot that is expected in a test.
263
+
264
+
Sometimes it might not make sense to continue the test if a prior snapshot failed. For example, when you make snapshots of a state-machine after various transitions you can abort the test once one transition produced the wrong state.
265
+
266
+
In that case you can implement a custom snapshot matcher that throws on the first mismatch instead of collecting every mismatch.
`expect.anything()` matches anything but `null` or `undefined`. You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value. For example, if you want to check that a mock function is called with a non-null argument:
Usually `jest` tries to match every snapshot that is expected in a test.
263
+
264
+
Sometimes it might not make sense to continue the test if a prior snapshot failed. For example, when you make snapshots of a state-machine after various transitions you can abort the test once one transition produced the wrong state.
265
+
266
+
In that case you can implement a custom snapshot matcher that throws on the first mismatch instead of collecting every mismatch.
`expect.anything()` matches anything but `null` or `undefined`. You can use it inside `toEqual` or `toBeCalledWith` instead of a literal value. For example, if you want to check that a mock function is called with a non-null argument:
0 commit comments