Skip to content
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

chore: do not escape strings in snapshots #12303

Merged
merged 3 commits into from
Feb 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/__tests__/__snapshots__/asyncAndCallback.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`errors when a test both returns a promise and takes a callback 1`] = `
FAIL __tests__/promise-and-callback.test.js
"FAIL __tests__/promise-and-callback.test.js
✕ promise-returning test with callback
✕ async test with callback
✕ test done before return value
Expand Down Expand Up @@ -49,5 +49,5 @@ FAIL __tests__/promise-and-callback.test.js
22 |
23 | return 'foobar';

at Object.it (__tests__/promise-and-callback.test.js:20:1)
at Object.it (__tests__/promise-and-callback.test.js:20:1)"
`;
4 changes: 2 additions & 2 deletions e2e/__tests__/__snapshots__/beforeAllFiltered.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Correct BeforeAll run ensures the BeforeAll of ignored suite is not run 1`] = `
console.log
" console.log
beforeAll 1

at log (__tests__/beforeAllFiltered.test.js:10:13)
Expand All @@ -25,5 +25,5 @@ exports[`Correct BeforeAll run ensures the BeforeAll of ignored suite is not run
afterAll 1

at log (__tests__/beforeAllFiltered.test.js:19:13)

"
`;
4 changes: 2 additions & 2 deletions e2e/__tests__/__snapshots__/beforeEachQueue.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Correct beforeEach order ensures the correct order for beforeEach 1`] = `
console.log
" console.log
BeforeEach

at Object.log (__tests__/beforeEachQueue.test.js:10:13)
Expand All @@ -25,5 +25,5 @@ exports[`Correct beforeEach order ensures the correct order for beforeEach 1`] =
It Bar

at Object.log (__tests__/beforeEachQueue.test.js:22:13)

"
`;
4 changes: 2 additions & 2 deletions e2e/__tests__/__snapshots__/callDoneTwice.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`\`done()\` should not be called more than once 1`] = `
FAIL __tests__/index.test.js
"FAIL __tests__/index.test.js
● \`done()\` called more than once › should fail

Expected done to be called once, but it was called multiple times.
Expand Down Expand Up @@ -85,5 +85,5 @@ FAIL __tests__/index.test.js
61 |
62 | it('should fail', () => {

at done (__tests__/index.test.js:59:5)
at done (__tests__/index.test.js:59:5)"
`;
4 changes: 2 additions & 2 deletions e2e/__tests__/__snapshots__/chaiAssertionLibrary.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`chai assertion errors should display properly 1`] = `
FAIL __tests__/chai_assertion.js
"FAIL __tests__/chai_assertion.js
● chai.js assertion library test › expect

assert.strictEqual(received, expected)
Expand Down Expand Up @@ -90,5 +90,5 @@ FAIL __tests__/chai_assertion.js
26 | });
27 |

at Object.strictEqual (__tests__/chai_assertion.js:24:17)
at Object.strictEqual (__tests__/chai_assertion.js:24:17)"
`;
8 changes: 4 additions & 4 deletions e2e/__tests__/__snapshots__/circularInequality.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`handles circular inequality properly 1`] = `
FAIL __tests__/test-1.js
"FAIL __tests__/test-1.js
● test

expect(received).toEqual(expected) // deep equality
Expand Down Expand Up @@ -41,13 +41,13 @@ FAIL __tests__/test-2.js
| ^
6 | });

at Object.toEqual (__tests__/test-2.js:5:15)
at Object.toEqual (__tests__/test-2.js:5:15)"
`;

exports[`handles circular inequality properly 2`] = `
Test Suites: 2 failed, 2 total
"Test Suites: 2 failed, 2 total
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites.
Ran all test suites."
`;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`defining tests and hooks asynchronously throws 1`] = `
FAIL __tests__/asyncDefinition.test.js
"FAIL __tests__/asyncDefinition.test.js


● Test suite failed to run
Expand Down Expand Up @@ -61,5 +61,5 @@ FAIL __tests__/asyncDefinition.test.js
21 |

at eventHandler (../../packages/jest-circus/build/eventHandler.js:158:11)
at afterAll (__tests__/asyncDefinition.test.js:19:3)
at afterAll (__tests__/asyncDefinition.test.js:19:3)"
`;
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CLI accepts exact file names if matchers matched 1`] = `
PASS foo/bar.spec.js
"PASS foo/bar.spec.js
✓ foo


Force exiting Jest: Have you considered using \`--detectOpenHandles\` to detect async operations that kept running after all tests finished?
Force exiting Jest: Have you considered using \`--detectOpenHandles\` to detect async operations that kept running after all tests finished?"
`;

exports[`CLI accepts exact file names if matchers matched 2`] = `
Test Suites: 1 passed, 1 total
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /.\\/foo\\/bar.spec.js/i.
Ran all test suites matching /.\\/foo\\/bar.spec.js/i."
`;
72 changes: 36 additions & 36 deletions e2e/__tests__/__snapshots__/console.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`console printing 1`] = `
PASS __tests__/console.test.js
"PASS __tests__/console.test.js
● Console

console.log
Expand Down Expand Up @@ -37,19 +37,19 @@ PASS __tests__/console.test.js
17 | });
18 |

at Object.error (__tests__/console.test.js:16:11)
at Object.error (__tests__/console.test.js:16:11)"
`;

exports[`console printing 2`] = `
Test Suites: 1 passed, 1 total
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites.
Ran all test suites."
`;

exports[`console printing with --verbose 1`] = `
console.log
" console.log
This is a log message.

at Object.log (__tests__/console.test.js:10:11)
Expand Down Expand Up @@ -83,26 +83,26 @@ exports[`console printing with --verbose 1`] = `
18 |

at Object.error (__tests__/console.test.js:16:11)

"
`;

exports[`console printing with --verbose 2`] = `
PASS __tests__/console.test.js
✓ works just fine
"PASS __tests__/console.test.js
✓ works just fine"
`;

exports[`console printing with --verbose 3`] = `
Test Suites: 1 passed, 1 total
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites.
Ran all test suites."
`;

exports[`does not error out when using winston 1`] = ``;
exports[`does not error out when using winston 1`] = `""`;

exports[`does not error out when using winston 2`] = `
PASS __tests__/console.test.js
"PASS __tests__/console.test.js
● Console

console.log
Expand All @@ -123,30 +123,30 @@ PASS __tests__/console.test.js
console.log
{"level":"error","message":"Error message from winston"}

at Console.log (node_modules/winston/lib/winston/transports/console.js:79:23)
at Console.log (node_modules/winston/lib/winston/transports/console.js:79:23)"
`;

exports[`does not error out when using winston 3`] = `
Test Suites: 1 passed, 1 total
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites.
Ran all test suites."
`;

exports[`does not print to console with --silent 1`] = ``;
exports[`does not print to console with --silent 1`] = `""`;

exports[`does not print to console with --silent 2`] = `PASS __tests__/console.test.js`;
exports[`does not print to console with --silent 2`] = `"PASS __tests__/console.test.js"`;

exports[`does not print to console with --silent 3`] = `
Test Suites: 1 passed, 1 total
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Time: <<REPLACED>>"
`;

exports[`respects --noStackTrace 1`] = `
console.log
" console.log
This is a log message.

at Object.log (__tests__/console.test.js:10:11)
Expand All @@ -165,24 +165,24 @@ exports[`respects --noStackTrace 1`] = `
This is an error message.

at Object.error (__tests__/console.test.js:16:11)

"
`;

exports[`respects --noStackTrace 2`] = `
PASS __tests__/console.test.js
✓ works just fine
"PASS __tests__/console.test.js
✓ works just fine"
`;

exports[`respects --noStackTrace 3`] = `
Test Suites: 1 passed, 1 total
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites.
Ran all test suites."
`;

exports[`respects noStackTrace in config 1`] = `
console.log
" console.log
This is a log message.

at Object.log (__tests__/console.test.js:10:11)
Expand All @@ -201,33 +201,33 @@ exports[`respects noStackTrace in config 1`] = `
This is an error message.

at Object.error (__tests__/console.test.js:16:11)

"
`;

exports[`respects noStackTrace in config 2`] = `
PASS __tests__/console.test.js
✓ works just fine
"PASS __tests__/console.test.js
✓ works just fine"
`;

exports[`respects noStackTrace in config 3`] = `
Test Suites: 1 passed, 1 total
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites.
Ran all test suites."
`;

exports[`the jsdom console is the same as the test console 1`] = ``;
exports[`the jsdom console is the same as the test console 1`] = `""`;

exports[`the jsdom console is the same as the test console 2`] = `
PASS __tests__/console.test.js
✓ can mock console.error calls from jsdom
"PASS __tests__/console.test.js
✓ can mock console.error calls from jsdom"
`;

exports[`the jsdom console is the same as the test console 3`] = `
Test Suites: 1 passed, 1 total
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites.
Ran all test suites."
`;
4 changes: 2 additions & 2 deletions e2e/__tests__/__snapshots__/consoleAfterTeardown.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`console printing 1`] = `
PASS __tests__/console.test.js
"PASS __tests__/console.test.js


● Cannot log after tests are done. Did you forget to wait for something async in your test?
Expand All @@ -13,5 +13,5 @@ PASS __tests__/console.test.js
| ^
13 | });
14 | });
15 |
15 |"
`;
12 changes: 6 additions & 6 deletions e2e/__tests__/__snapshots__/consoleDebugging.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`console debugging with --verbose 1`] = `
console.log
" console.log
test

at Object.log (__tests__/console-debugging.test.js:17:11)

"
`;

exports[`console debugging with --verbose 2`] = `
PASS __tests__/console-debugging.test.js
✓ verbose mode prints console output synchronously
"PASS __tests__/console-debugging.test.js
✓ verbose mode prints console output synchronously"
`;

exports[`console debugging with --verbose 3`] = `
Test Suites: 1 passed, 1 total
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 1 passed, 1 total
Time: <<REPLACED>>
Ran all test suites.
Ran all test suites."
`;
Loading