mirror of
https://github.com/hanzoai/jest.git
synced 2026-10-30 14:46:24 +00:00
122 lines
4.0 KiB
Plaintext
122 lines
4.0 KiB
Plaintext
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||
|
||
exports[`can bail with a custom inline snapshot matcher 1`] = `
|
||
"FAIL __tests__/bail.test.js
|
||
✕ transitions as expected
|
||
|
||
● transitions as expected
|
||
|
||
expect(received).toMatchInlineSnapshot(snapshot)
|
||
|
||
Snapshot name: \`transitions as expected 2\`
|
||
|
||
Snapshot: "loading"
|
||
Received: "initial"
|
||
|
||
28 | transition();
|
||
29 | // Already produces a mismatch. No point in continuing the test.
|
||
> 30 | expect(state).toMatchStateInlineSnapshot(\`"loading"\`);
|
||
| ^
|
||
31 | transition();
|
||
32 | expect(state).toMatchStateInlineSnapshot(\`"done"\`);
|
||
33 | });
|
||
|
||
at Object.toMatchStateInlineSnapshot (__tests__/bail.test.js:30:17)
|
||
|
||
› 1 snapshot failed.
|
||
Snapshot Summary
|
||
› 1 snapshot failed from 1 test suite. Inspect your code changes or re-run jest with \`-u\` to update them."
|
||
`;
|
||
|
||
exports[`works with custom inline snapshot matchers 1`] = `
|
||
"FAIL __tests__/asynchronous.test.js
|
||
✕ new async, inline snapshots
|
||
✕ mismatching async, inline snapshots
|
||
|
||
● new async, inline snapshots
|
||
|
||
expect(received).toMatchInlineSnapshot()
|
||
|
||
Snapshot name: \`new async, inline snapshots 1\`
|
||
|
||
New snapshot was not written. The update flag must be explicitly passed to write a new snapshot.
|
||
|
||
This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.
|
||
|
||
Received: "result #1"
|
||
|
||
20 |
|
||
21 | test('new async, inline snapshots', async () => {
|
||
> 22 | await expect(async () => 'result #1').toMatchObservationInlineSnapshot();
|
||
| ^
|
||
23 | await expect(async () => 'result #2').toMatchObservationInlineSnapshot();
|
||
24 | });
|
||
25 |
|
||
|
||
at Object.toMatchObservationInlineSnapshot (__tests__/asynchronous.test.js:22:41)
|
||
|
||
● new async, inline snapshots
|
||
|
||
expect(received).toMatchInlineSnapshot()
|
||
|
||
Snapshot name: \`new async, inline snapshots 2\`
|
||
|
||
New snapshot was not written. The update flag must be explicitly passed to write a new snapshot.
|
||
|
||
This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.
|
||
|
||
Received: "result #2"
|
||
|
||
21 | test('new async, inline snapshots', async () => {
|
||
22 | await expect(async () => 'result #1').toMatchObservationInlineSnapshot();
|
||
> 23 | await expect(async () => 'result #2').toMatchObservationInlineSnapshot();
|
||
| ^
|
||
24 | });
|
||
25 |
|
||
26 | test('mismatching async, inline snapshots', async () => {
|
||
|
||
at Object.toMatchObservationInlineSnapshot (__tests__/asynchronous.test.js:23:41)
|
||
|
||
● mismatching async, inline snapshots
|
||
|
||
expect(received).toMatchInlineSnapshot(snapshot)
|
||
|
||
Snapshot name: \`mismatching async, inline snapshots 1\`
|
||
|
||
Snapshot: "result #?"
|
||
Received: "result #1"
|
||
|
||
25 |
|
||
26 | test('mismatching async, inline snapshots', async () => {
|
||
> 27 | await expect(async () => 'result #1').toMatchObservationInlineSnapshot(
|
||
| ^
|
||
28 | \`"result #?"\`,
|
||
29 | );
|
||
30 | await expect(async () => 'result #2').toMatchObservationInlineSnapshot(
|
||
|
||
at Object.toMatchObservationInlineSnapshot (__tests__/asynchronous.test.js:27:41)
|
||
|
||
● mismatching async, inline snapshots
|
||
|
||
expect(received).toMatchInlineSnapshot(snapshot)
|
||
|
||
Snapshot name: \`mismatching async, inline snapshots 2\`
|
||
|
||
Snapshot: "result #?"
|
||
Received: "result #2"
|
||
|
||
28 | \`"result #?"\`,
|
||
29 | );
|
||
> 30 | await expect(async () => 'result #2').toMatchObservationInlineSnapshot(
|
||
| ^
|
||
31 | \`"result #?"\`,
|
||
32 | );
|
||
33 | });
|
||
|
||
at Object.toMatchObservationInlineSnapshot (__tests__/asynchronous.test.js:30:41)
|
||
|
||
› 4 snapshots failed.
|
||
Snapshot Summary
|
||
› 4 snapshots failed from 1 test suite. Inspect your code changes or re-run jest with \`-u\` to update them."
|
||
`;
|