We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b2f198 commit 9d37eb3Copy full SHA for 9d37eb3
e2e/custom-inline-snapshot-matchers/__tests__/asynchronous.test.js
@@ -9,6 +9,9 @@ const {toMatchInlineSnapshot} = require('jest-snapshot');
9
expect.extend({
10
async toMatchObservationInlineSnapshot(fn, ...args) {
11
this.error = new Error();
12
+ // This specific behavior can be implemented without a custom matcher.
13
+ // In a real example one might want to observe some global value that `fn()` is affecting.
14
+ // The difference between before and after `fn()` might then be persisted as a snapshot.
15
const result = await fn();
16
17
return toMatchInlineSnapshot.call(this, result, ...args);
0 commit comments