Skip to content

Commit

Permalink
Make toPretty() render prettier output
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonchinn178 committed Sep 30, 2023
1 parent 70a3999 commit 3c22ef3
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ exports[`CLI accepts exact file names if matchers matched 2`] = `
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."
`;
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/customReporters.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ exports[`Custom Reporters Integration default reporters enabled 2`] = `
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /add.test.js/i."
Ran all test suites matching add.test.js."
`;
exports[`Custom Reporters Integration default reporters enabled 3`] = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Object {
Tests: 1 skipped, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /hookInDescribeWithSkippedTest.test.js/i.",
Ran all test suites matching hookInDescribeWithSkippedTest.test.js.",
}
`;

Expand All @@ -34,7 +34,7 @@ Object {
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /hookInEmptyDescribe.test.js/i.",
Ran all test suites matching hookInEmptyDescribe.test.js.",
}
`;
Expand All @@ -61,7 +61,7 @@ Object {
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /hookInEmptyNestedDescribe.test.js/i.",
Ran all test suites matching hookInEmptyNestedDescribe.test.js.",
}
`;
Expand Down Expand Up @@ -133,6 +133,6 @@ Object {
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /multipleHooksInEmptyDescribe.test.js/i.",
Ran all test suites matching multipleHooksInEmptyDescribe.test.js.",
}
`;
4 changes: 2 additions & 2 deletions e2e/__tests__/__snapshots__/findRelatedFiles.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`--findRelatedTests flag coverage configuration is applied correctly 1`]
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites related to files matching /a.js|b.js/i."
Ran all test suites related to files matching a.js|b.js."
`;
exports[`--findRelatedTests flag coverage configuration is applied correctly 2`] = `
Expand Down Expand Up @@ -50,7 +50,7 @@ exports[`--findRelatedTests flag generates coverage report for filename 4`] = `
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites related to files matching /a.js/i."
Ran all test suites related to files matching a.js."
`;
exports[`--findRelatedTests flag generates coverage report for filename 5`] = `
Expand Down
14 changes: 7 additions & 7 deletions e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,53 @@ exports[`does not enforce import assertions 1`] = `
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm-missing-import-assertions.test/i."
Ran all test suites matching native-esm-missing-import-assertions.test."
`;
exports[`on node >=16.9.0 support re-exports from CJS of dual packages 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm-deep-cjs-reexport.test.js/i."
Ran all test suites matching native-esm-deep-cjs-reexport.test.js."
`;
exports[`on node >=16.12.0 supports import assertions 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm-import-assertions.test/i."
Ran all test suites matching native-esm-import-assertions.test."
`;
exports[`runs WebAssembly (Wasm) test with native ESM 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 6 passed, 6 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm-wasm.test.js/i."
Ran all test suites matching native-esm-wasm.test.js."
`;
exports[`runs test with native ESM 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 33 passed, 33 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm.test.js/i."
Ran all test suites matching native-esm.test.js."
`;
exports[`support re-exports from CJS of core module 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm-core-cjs-reexport.test.js/i."
Ran all test suites matching native-esm-core-cjs-reexport.test.js."
`;
exports[`supports top-level await 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /native-esm.tla.test.js/i."
Ran all test suites matching native-esm.tla.test.js."
`;
12 changes: 6 additions & 6 deletions e2e/__tests__/__snapshots__/promiseAsyncHandling.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Object {
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /unhandledRejectionAfterAll.test.js/i.",
Ran all test suites matching unhandledRejectionAfterAll.test.js.",
}
`;
Expand Down Expand Up @@ -63,7 +63,7 @@ Object {
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /unhandledRejectionAfterEach.test.js/i.",
Ran all test suites matching unhandledRejectionAfterEach.test.js.",
}
`;
Expand All @@ -89,7 +89,7 @@ Object {
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /unhandledRejectionBeforeAll.test.js/i.",
Ran all test suites matching unhandledRejectionBeforeAll.test.js.",
}
`;
Expand Down Expand Up @@ -130,7 +130,7 @@ Object {
Tests: 2 failed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /unhandledRejectionBeforeEach.test.js/i.",
Ran all test suites matching unhandledRejectionBeforeEach.test.js.",
}
`;
Expand Down Expand Up @@ -217,7 +217,7 @@ Object {
Tests: 4 failed, 4 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /unhandledRejectionTest.test.js/i.",
Ran all test suites matching unhandledRejectionTest.test.js.",
}
`;
Expand All @@ -231,6 +231,6 @@ Object {
Tests: 3 passed, 3 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /rejectionHandled.test.js/i.",
Ran all test suites matching rejectionHandled.test.js.",
}
`;
14 changes: 7 additions & 7 deletions e2e/__tests__/__snapshots__/snapshot.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -85,53 +85,53 @@ exports[`Snapshot works with escaped characters 1`] = `
Tests: 1 passed, 1 total
Snapshots: 1 written, 1 total
Time: <<REPLACED>>
Ran all test suites matching /snapshot.test.js/i."
Ran all test suites matching snapshot.test.js."
`;
exports[`Snapshot works with escaped characters 2`] = `
"Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 1 written, 1 passed, 2 total
Time: <<REPLACED>>
Ran all test suites matching /snapshot.test.js/i."
Ran all test suites matching snapshot.test.js."
`;
exports[`Snapshot works with escaped characters 3`] = `
"Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 2 passed, 2 total
Time: <<REPLACED>>
Ran all test suites matching /snapshot.test.js/i."
Ran all test suites matching snapshot.test.js."
`;
exports[`Snapshot works with escaped regex 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 2 written, 2 total
Time: <<REPLACED>>
Ran all test suites matching /snapshotEscapeRegex.js/i."
Ran all test suites matching snapshotEscapeRegex.js."
`;
exports[`Snapshot works with escaped regex 2`] = `
"Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 2 passed, 2 total
Time: <<REPLACED>>
Ran all test suites matching /snapshotEscapeRegex.js/i."
Ran all test suites matching snapshotEscapeRegex.js."
`;
exports[`Snapshot works with template literal substitutions 1`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 1 written, 1 total
Time: <<REPLACED>>
Ran all test suites matching /snapshotEscapeSubstitution.test.js/i."
Ran all test suites matching snapshotEscapeSubstitution.test.js."
`;
exports[`Snapshot works with template literal substitutions 2`] = `
"Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 1 passed, 1 total
Time: <<REPLACED>>
Ran all test suites matching /snapshotEscapeSubstitution.test.js/i."
Ran all test suites matching snapshotEscapeSubstitution.test.js."
`;
14 changes: 7 additions & 7 deletions e2e/__tests__/__snapshots__/stackTrace.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,53 @@ exports[`Stack Trace does not print a stack trace for errors when --noStackTrace
Tests: 3 failed, 3 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /testError.test.js/i."
Ran all test suites matching testError.test.js."
`;
exports[`Stack Trace does not print a stack trace for matching errors when --noStackTrace is given 1`] = `
"Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /stackTrace.test.js/i."
Ran all test suites matching stackTrace.test.js."
`;
exports[`Stack Trace does not print a stack trace for runtime errors when --noStackTrace is given 1`] = `
"Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /runtimeError.test.js/i."
Ran all test suites matching runtimeError.test.js."
`;
exports[`Stack Trace prints a stack trace for errors 1`] = `
"Test Suites: 1 failed, 1 total
Tests: 3 failed, 3 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /testError.test.js/i."
Ran all test suites matching testError.test.js."
`;
exports[`Stack Trace prints a stack trace for errors without message in stack trace 1`] = `
"Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /stackTraceWithoutMessage.test.js/i."
Ran all test suites matching stackTraceWithoutMessage.test.js."
`;
exports[`Stack Trace prints a stack trace for matching errors 1`] = `
"Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /stackTrace.test.js/i."
Ran all test suites matching stackTrace.test.js."
`;
exports[`Stack Trace prints a stack trace for runtime errors 1`] = `
"Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /runtimeError.test.js/i."
Ran all test suites matching runtimeError.test.js."
`;
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/testTodo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Test Suites: 1 passed, 1 total
Tests: 2 todo, 1 passed, 3 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /only-todo.test.js/i."
Ran all test suites matching only-todo.test.js."
`;
exports[`shows error messages when called with invalid argument 1`] = `
Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/watchModePatterns.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ exports[`can press "p" to filter by file name: test summary 2`] = `
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: <<REPLACED>>
Ran all test suites matching /bar/i."
Ran all test suites matching bar."
`;
exports[`can press "t" to filter by test name 1`] = `
Expand Down
8 changes: 4 additions & 4 deletions e2e/__tests__/findRelatedFiles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('--findRelatedTests flag', () => {
const {stderr} = runJest(DIR, ['--findRelatedTests', 'a.js']);
expect(stderr).toMatch('PASS __tests__/test.test.js');

const summaryMsg = 'Ran all test suites related to files matching /a.js/i.';
const summaryMsg = 'Ran all test suites related to files matching a.js.';
expect(stderr).toMatch(summaryMsg);
});

Expand All @@ -59,7 +59,7 @@ describe('--findRelatedTests flag', () => {
const {stderr} = runJest(DIR, ['--findRelatedTests', 'A.JS']);
expect(stderr).toMatch('PASS __tests__/test.test.js');

const summaryMsg = 'Ran all test suites related to files matching /A.JS/i.';
const summaryMsg = 'Ran all test suites related to files matching A.JS.';
expect(stderr).toMatch(summaryMsg);
});

Expand Down Expand Up @@ -112,7 +112,7 @@ describe('--findRelatedTests flag', () => {
expect(stderr).toMatch('PASS __tests__/test.test.js');
expect(stderr).not.toMatch('PASS __tests__/test-skip-deps.test.js');

const summaryMsg = 'Ran all test suites related to files matching /a.js/i.';
const summaryMsg = 'Ran all test suites related to files matching a.js.';
expect(stderr).toMatch(summaryMsg);
});

Expand Down Expand Up @@ -162,7 +162,7 @@ describe('--findRelatedTests flag', () => {
expect(stderr).toMatch('PASS __tests__/test.test.js');
expect(stderr).not.toMatch('PASS __tests__/test-skip-deps.test.js');

const summaryMsg = 'Ran all test suites related to files matching /a.js/i.';
const summaryMsg = 'Ran all test suites related to files matching a.js.';
expect(stderr).toMatch(summaryMsg);
});

Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/multiProjectRunner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ test('"No tests found" message for projects', () => {
'project1',
'project2',
]);
expect(verboseOutput).toContain('Pattern: /xyz321/i - 0 matches');
expect(verboseOutput).toContain('Pattern: xyz321 - 0 matches');
const {stdout} = runJest(DIR, [
'--no-watchman',
'xyz321',
Expand Down
8 changes: 4 additions & 4 deletions e2e/__tests__/testPathPatternReporterMessage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ test('prints a message with path pattern at the end', () => {
let stderr;

({stderr} = runJest(DIR, ['a']));
expect(stderr).toMatch('Ran all test suites matching /a/i');
expect(stderr).toMatch('Ran all test suites matching a');

({stderr} = runJest(DIR, ['a', 'b']));
expect(stderr).toMatch('Ran all test suites matching /a|b/i');
expect(stderr).toMatch('Ran all test suites matching a|b');

({stderr} = runJest(DIR, ['--testPathPatterns', 'a']));
expect(stderr).toMatch('Ran all test suites matching /a/i');
expect(stderr).toMatch('Ran all test suites matching a');

({stderr} = runJest(DIR, ['--testPathPatterns', 'a|b']));
expect(stderr).toMatch('Ran all test suites matching /a|b/i');
expect(stderr).toMatch('Ran all test suites matching a|b');
});
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,9 @@ exports[`testMatch throws if testRegex and testMatch are both specified 1`] = `
<red></color>"
`;
exports[`testPathPatterns <regexForTestFiles> ignores invalid regular expressions and logs a warning 1`] = `"<red> Invalid testPattern /a(/i supplied. Running all tests instead.</color>"`;
exports[`testPathPatterns <regexForTestFiles> ignores invalid regular expressions and logs a warning 1`] = `"<red> Invalid testPattern a( supplied. Running all tests instead.</color>"`;
exports[`testPathPatterns --testPathPatterns ignores invalid regular expressions and logs a warning 1`] = `"<red> Invalid testPattern /a(/i supplied. Running all tests instead.</color>"`;
exports[`testPathPatterns --testPathPatterns ignores invalid regular expressions and logs a warning 1`] = `"<red> Invalid testPattern a( supplied. Running all tests instead.</color>"`;
exports[`testTimeout should throw an error if timeout is a negative number 1`] = `
"<red><bold><bold>● </intensity><bold>Validation Error</intensity>:</color>
Expand Down
Loading

0 comments on commit 3c22ef3

Please sign in to comment.