From 30b8fb0f0ec77530f96f956ef1d67fd5d7ed0c0e Mon Sep 17 00:00:00 2001 From: Willian Agostini Date: Tue, 9 Jan 2024 01:28:45 +0000 Subject: [PATCH 1/7] feat: add percent of running tests --- packages/jest-reporters/src/getSummary.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/jest-reporters/src/getSummary.ts b/packages/jest-reporters/src/getSummary.ts index 6e2bb5fe3725..5174fbd07ded 100644 --- a/packages/jest-reporters/src/getSummary.ts +++ b/packages/jest-reporters/src/getSummary.ts @@ -124,6 +124,9 @@ export default function getSummary( optionalLines.push(`${chalk.bold('Seed: ') + seed}`); } + const percent = ( + ((suitesPending || 0) + (suitesRun || 0) * 100) / (suitesTotal || 0) || 100 + ).toFixed(0); const suites = `${ chalk.bold('Test Suites: ') + (suitesFailed ? `${chalk.bold.red(`${suitesFailed} failed`)}, ` : '') + @@ -132,7 +135,7 @@ export default function getSummary( : '') + (suitesPassed ? `${chalk.bold.green(`${suitesPassed} passed`)}, ` : '') + (suitesRun === suitesTotal ? suitesTotal : `${suitesRun} of ${suitesTotal}`) - } total`; + } total (${percent}%)`; const updatedTestsFailed = testsFailed + valuesForCurrentTestCases.numFailingTests; From 29baa6fa4f142d37560dd7f16d3e08b7f626d001 Mon Sep 17 00:00:00 2001 From: Willian Agostini Date: Tue, 9 Jan 2024 01:45:09 +0000 Subject: [PATCH 2/7] test: update snapshots --- .../cliHandlesExactFilenames.test.ts.snap | 2 +- .../__snapshots__/console.test.ts.snap | 14 ++++---- .../consoleDebugging.test.ts.snap | 2 +- ...consoleLogOutputWhenRunInBand.test.ts.snap | 2 +- .../__snapshots__/coverageReport.test.ts.snap | 2 +- .../coverageThreshold.test.ts.snap | 8 ++--- .../customReporters.test.ts.snap | 2 +- .../__snapshots__/domDiffing.test.ts.snap | 2 +- .../emptyDescribeWithHooks.test.ts.snap | 8 ++--- .../findRelatedFiles.test.ts.snap | 6 ++-- .../__snapshots__/globals.test.ts.snap | 22 ++++++------ .../__snapshots__/injectGlobals.test.ts.snap | 4 +-- .../isolateModulesAsync.test.ts.snap | 2 +- .../__snapshots__/jest.config.js.test.ts.snap | 4 +-- .../__snapshots__/jest.config.ts.test.ts.snap | 6 ++-- .../multiProjectRunner.test.ts.snap | 6 ++-- .../__snapshots__/nativeEsm.test.ts.snap | 14 ++++---- .../promiseAsyncHandling.test.ts.snap | 12 +++---- .../__snapshots__/resolveAsync.test.ts.snap | 2 +- ...grammaticallyMultipleProjects.test.ts.snap | 2 +- .../__snapshots__/snapshot.test.ts.snap | 34 +++++++++---------- .../__snapshots__/snapshotMockFs.test.ts.snap | 2 +- .../__snapshots__/stackTrace.test.ts.snap | 14 ++++---- .../__snapshots__/testMatch.test.ts.snap | 2 +- .../testMatchDefault.test.ts.snap | 2 +- .../__snapshots__/testMatchTs.test.ts.snap | 2 +- .../testNamePattern.test.ts.snap | 2 +- .../testNamePatternSkipped.test.ts.snap | 2 +- .../__snapshots__/testTodo.test.ts.snap | 2 +- .../__snapshots__/timeouts.test.ts.snap | 14 ++++---- .../watchModeOnlyFailed.test.ts.snap | 4 +-- .../watchModePatterns.test.ts.snap | 8 ++--- .../watchModeUpdateSnapshot.test.ts.snap | 4 +-- .../workerRestartBeforeSend.test.ts.snap | 2 +- .../workerRestarting.test.ts.snap | 2 +- .../SummaryReporter.test.js.snap | 14 ++++---- .../__snapshots__/getSummary.test.ts.snap | 4 +-- 37 files changed, 118 insertions(+), 118 deletions(-) diff --git a/e2e/__tests__/__snapshots__/cliHandlesExactFilenames.test.ts.snap b/e2e/__tests__/__snapshots__/cliHandlesExactFilenames.test.ts.snap index e8c3c1073714..6699420dd387 100644 --- a/e2e/__tests__/__snapshots__/cliHandlesExactFilenames.test.ts.snap +++ b/e2e/__tests__/__snapshots__/cliHandlesExactFilenames.test.ts.snap @@ -9,7 +9,7 @@ Force exiting Jest: Have you considered using \`--detectOpenHandles\` to detect `; exports[`CLI accepts exact file names if matchers matched 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/console.test.ts.snap b/e2e/__tests__/__snapshots__/console.test.ts.snap index 849933bd86c4..1bc3c1c91236 100644 --- a/e2e/__tests__/__snapshots__/console.test.ts.snap +++ b/e2e/__tests__/__snapshots__/console.test.ts.snap @@ -41,7 +41,7 @@ exports[`console printing 1`] = ` `; exports[`console printing 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -92,7 +92,7 @@ exports[`console printing with --verbose 2`] = ` `; exports[`console printing with --verbose 3`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -127,7 +127,7 @@ exports[`does not error out when using winston 2`] = ` `; exports[`does not error out when using winston 3`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -139,7 +139,7 @@ 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 3`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <>" @@ -174,7 +174,7 @@ exports[`respects --noStackTrace 2`] = ` `; exports[`respects --noStackTrace 3`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -210,7 +210,7 @@ exports[`respects noStackTrace in config 2`] = ` `; exports[`respects noStackTrace in config 3`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -225,7 +225,7 @@ exports[`the jsdom console is the same as the test console 2`] = ` `; exports[`the jsdom console is the same as the test console 3`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/consoleDebugging.test.ts.snap b/e2e/__tests__/__snapshots__/consoleDebugging.test.ts.snap index 4bc14067c0cf..eda1636ac768 100644 --- a/e2e/__tests__/__snapshots__/consoleDebugging.test.ts.snap +++ b/e2e/__tests__/__snapshots__/consoleDebugging.test.ts.snap @@ -14,7 +14,7 @@ exports[`console debugging with --verbose 2`] = ` `; exports[`console debugging with --verbose 3`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 1 passed, 1 total Time: <> diff --git a/e2e/__tests__/__snapshots__/consoleLogOutputWhenRunInBand.test.ts.snap b/e2e/__tests__/__snapshots__/consoleLogOutputWhenRunInBand.test.ts.snap index 7afe4b918b81..32e940d43e92 100644 --- a/e2e/__tests__/__snapshots__/consoleLogOutputWhenRunInBand.test.ts.snap +++ b/e2e/__tests__/__snapshots__/consoleLogOutputWhenRunInBand.test.ts.snap @@ -9,7 +9,7 @@ Force exiting Jest: Have you considered using \`--detectOpenHandles\` to detect `; exports[`prints console.logs when run with forceExit 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/coverageReport.test.ts.snap b/e2e/__tests__/__snapshots__/coverageReport.test.ts.snap index bf48e0520423..6764161afd57 100644 --- a/e2e/__tests__/__snapshots__/coverageReport.test.ts.snap +++ b/e2e/__tests__/__snapshots__/coverageReport.test.ts.snap @@ -61,7 +61,7 @@ All files | 60 | 0 | 50 | 60 | `; exports[`json reporter printing with --coverage 1`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 skipped, 2 passed, 4 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/coverageThreshold.test.ts.snap b/e2e/__tests__/__snapshots__/coverageThreshold.test.ts.snap index 0fe03e7e827b..b7e579afe2c4 100644 --- a/e2e/__tests__/__snapshots__/coverageThreshold.test.ts.snap +++ b/e2e/__tests__/__snapshots__/coverageThreshold.test.ts.snap @@ -8,7 +8,7 @@ Jest: "global" coverage threshold for lines (100%) not met: 0%" `; exports[`excludes tests matched by path threshold groups from global group 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -42,7 +42,7 @@ Jest: "global" coverage threshold for lines (90%) not met: 50%" `; exports[`exits with 1 if coverage threshold is not met 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -66,7 +66,7 @@ Jest: Coverage data for apple.js was not found." `; exports[`exits with 1 if path threshold group is not found in coverage data 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -92,7 +92,7 @@ Jest: "./banana.js" coverage threshold for lines (100%) not met: 50%" `; exports[`file is matched by all path and glob threshold groups 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/customReporters.test.ts.snap b/e2e/__tests__/__snapshots__/customReporters.test.ts.snap index d3fa7a739372..f2105012da05 100644 --- a/e2e/__tests__/__snapshots__/customReporters.test.ts.snap +++ b/e2e/__tests__/__snapshots__/customReporters.test.ts.snap @@ -78,7 +78,7 @@ exports[`Custom Reporters Integration default reporters enabled 1`] = ` `; exports[`Custom Reporters Integration default reporters enabled 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/domDiffing.test.ts.snap b/e2e/__tests__/__snapshots__/domDiffing.test.ts.snap index 54ed6f57b73a..21f4dfa5ce0e 100644 --- a/e2e/__tests__/__snapshots__/domDiffing.test.ts.snap +++ b/e2e/__tests__/__snapshots__/domDiffing.test.ts.snap @@ -45,7 +45,7 @@ exports[`should work without error 1`] = ` `; exports[`should work without error 2`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 2 failed, 2 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/emptyDescribeWithHooks.test.ts.snap b/e2e/__tests__/__snapshots__/emptyDescribeWithHooks.test.ts.snap index 71a0140e2a86..9849a5ff0b91 100644 --- a/e2e/__tests__/__snapshots__/emptyDescribeWithHooks.test.ts.snap +++ b/e2e/__tests__/__snapshots__/emptyDescribeWithHooks.test.ts.snap @@ -3,7 +3,7 @@ exports[`hook in describe with skipped test 1`] = ` Object { "rest": "", - "summary": "Test Suites: 1 skipped, 0 of 1 total + "summary": "Test Suites: 1 skipped, 0 of 1 total (1%) Tests: 1 skipped, 1 total Snapshots: 0 total Time: <> @@ -30,7 +30,7 @@ Object { at beforeEach (__tests__/hookInEmptyDescribe.test.js:9:3) at Object.describe (__tests__/hookInEmptyDescribe.test.js:8:1)", - "summary": "Test Suites: 1 failed, 1 total + "summary": "Test Suites: 1 failed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -57,7 +57,7 @@ Object { at beforeEach (__tests__/hookInEmptyNestedDescribe.test.js:9:3) at Object.describe (__tests__/hookInEmptyNestedDescribe.test.js:8:1)", - "summary": "Test Suites: 1 failed, 1 total + "summary": "Test Suites: 1 failed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -129,7 +129,7 @@ Object { at beforeAll (__tests__/multipleHooksInEmptyDescribe.test.js:12:3) at Object.describe (__tests__/multipleHooksInEmptyDescribe.test.js:8:1)", - "summary": "Test Suites: 1 failed, 1 total + "summary": "Test Suites: 1 failed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/findRelatedFiles.test.ts.snap b/e2e/__tests__/__snapshots__/findRelatedFiles.test.ts.snap index 7c1eb192a715..cd179101977f 100644 --- a/e2e/__tests__/__snapshots__/findRelatedFiles.test.ts.snap +++ b/e2e/__tests__/__snapshots__/findRelatedFiles.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`--findRelatedTests flag coverage configuration is applied correctly 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -23,7 +23,7 @@ All files | 100 | 100 | 100 | 100 | `; exports[`--findRelatedTests flag generates coverage report for filename 1`] = ` -"Test Suites: 2 passed, 2 total +"Test Suites: 2 passed, 2 total (100%) Tests: 2 passed, 2 total Snapshots: 0 total Time: <> @@ -46,7 +46,7 @@ All files | 100 | 100 | 100 | 100 | `; exports[`--findRelatedTests flag generates coverage report for filename 4`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/globals.test.ts.snap b/e2e/__tests__/__snapshots__/globals.test.ts.snap index d1ed6b3a51db..0a8e632181c6 100644 --- a/e2e/__tests__/__snapshots__/globals.test.ts.snap +++ b/e2e/__tests__/__snapshots__/globals.test.ts.snap @@ -10,7 +10,7 @@ exports[`basic test constructs 1`] = ` `; exports[`basic test constructs 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 4 passed, 4 total Snapshots: 0 total Time: <> @@ -30,7 +30,7 @@ exports[`cannot have describe with no implementation 1`] = ` `; exports[`cannot have describe with no implementation 2`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 0 total Snapshots: 0 total Time: <> @@ -52,7 +52,7 @@ exports[`cannot test with no implementation 1`] = ` `; exports[`cannot test with no implementation 2`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 0 total Snapshots: 0 total Time: <> @@ -74,7 +74,7 @@ exports[`cannot test with no implementation with expand arg 1`] = ` `; exports[`cannot test with no implementation with expand arg 2`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 0 total Snapshots: 0 total Time: <> @@ -88,7 +88,7 @@ exports[`function as describe() descriptor 1`] = ` `; exports[`function as describe() descriptor 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -101,7 +101,7 @@ exports[`function as it() descriptor 1`] = ` `; exports[`function as it() descriptor 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -117,7 +117,7 @@ exports[`interleaved describe and test children order 1`] = ` `; exports[`interleaved describe and test children order 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 3 passed, 3 total Snapshots: 0 total Time: <> @@ -140,7 +140,7 @@ exports[`only 1`] = ` `; exports[`only 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 skipped, 7 passed, 8 total Snapshots: 0 total Time: <> @@ -163,7 +163,7 @@ exports[`only with expand arg 1`] = ` `; exports[`only with expand arg 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 skipped, 7 passed, 8 total Snapshots: 0 total Time: <> @@ -187,7 +187,7 @@ exports[`skips 1`] = ` `; exports[`skips 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 8 skipped, 1 passed, 9 total Snapshots: 0 total Time: <> @@ -211,7 +211,7 @@ exports[`skips with expand arg 1`] = ` `; exports[`skips with expand arg 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 8 skipped, 1 passed, 9 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/injectGlobals.test.ts.snap b/e2e/__tests__/__snapshots__/injectGlobals.test.ts.snap index 74c718ed91b9..28f2b8b25455 100644 --- a/e2e/__tests__/__snapshots__/injectGlobals.test.ts.snap +++ b/e2e/__tests__/__snapshots__/injectGlobals.test.ts.snap @@ -6,7 +6,7 @@ exports[`globals are undefined if passed \`false\` from CLI 1`] = ` `; exports[`globals are undefined if passed \`false\` from CLI 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -19,7 +19,7 @@ exports[`globals are undefined if passed \`false\` from config 1`] = ` `; exports[`globals are undefined if passed \`false\` from config 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/isolateModulesAsync.test.ts.snap b/e2e/__tests__/__snapshots__/isolateModulesAsync.test.ts.snap index c1577869b112..be3d5ce59c0f 100644 --- a/e2e/__tests__/__snapshots__/isolateModulesAsync.test.ts.snap +++ b/e2e/__tests__/__snapshots__/isolateModulesAsync.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`runs test with isolate modules async import 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/jest.config.js.test.ts.snap b/e2e/__tests__/__snapshots__/jest.config.js.test.ts.snap index 45f2b0bcb85b..919ee6df54b7 100644 --- a/e2e/__tests__/__snapshots__/jest.config.js.test.ts.snap +++ b/e2e/__tests__/__snapshots__/jest.config.js.test.ts.snap @@ -15,7 +15,7 @@ exports[`traverses directory tree up until it finds jest.config 2`] = ` `; exports[`traverses directory tree up until it finds jest.config 3`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 2 passed, 2 total Snapshots: 0 total Time: <> @@ -28,7 +28,7 @@ exports[`works with jest.config.js 1`] = ` `; exports[`works with jest.config.js 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/jest.config.ts.test.ts.snap b/e2e/__tests__/__snapshots__/jest.config.ts.test.ts.snap index 7ecbcfe06551..5669ad0390a3 100644 --- a/e2e/__tests__/__snapshots__/jest.config.ts.test.ts.snap +++ b/e2e/__tests__/__snapshots__/jest.config.ts.test.ts.snap @@ -15,7 +15,7 @@ exports[`traverses directory tree up until it finds jest.config 2`] = ` `; exports[`traverses directory tree up until it finds jest.config 3`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 2 passed, 2 total Snapshots: 0 total Time: <> @@ -28,7 +28,7 @@ exports[`works with jest.config.ts 1`] = ` `; exports[`works with jest.config.ts 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -41,7 +41,7 @@ exports[`works with tsconfig.json 1`] = ` `; exports[`works with tsconfig.json 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/multiProjectRunner.test.ts.snap b/e2e/__tests__/__snapshots__/multiProjectRunner.test.ts.snap index bf72a9f9bf37..573fb7bc70b5 100644 --- a/e2e/__tests__/__snapshots__/multiProjectRunner.test.ts.snap +++ b/e2e/__tests__/__snapshots__/multiProjectRunner.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`can pass projects or global config 1`] = ` -"Test Suites: 3 failed, 3 total +"Test Suites: 3 failed, 3 total (100%) Tests: 0 total Snapshots: 0 total Time: <> @@ -9,7 +9,7 @@ Ran all test suites." `; exports[`can pass projects or global config 2`] = ` -"Test Suites: 3 passed, 3 total +"Test Suites: 3 passed, 3 total (100%) Tests: 3 passed, 3 total Snapshots: 0 total Time: <> @@ -23,7 +23,7 @@ PASS project2/__tests__/file1.test.js" `; exports[`can pass projects or global config 4`] = ` -"Test Suites: 3 passed, 3 total +"Test Suites: 3 passed, 3 total (100%) Tests: 3 passed, 3 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap b/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap index 96bf4cb3c3f9..1d4ccd4b6040 100644 --- a/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap +++ b/e2e/__tests__/__snapshots__/nativeEsm.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`does not enforce import assertions 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 2 passed, 2 total Snapshots: 0 total Time: <> @@ -9,7 +9,7 @@ Ran all test suites matching native-esm-missing-import-assertions.test.js." `; exports[`on node >=16.11.0 support re-exports from CJS of dual packages 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -17,7 +17,7 @@ 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 +"Test Suites: 1 passed, 1 total (100%) Tests: 2 passed, 2 total Snapshots: 0 total Time: <> @@ -33,7 +33,7 @@ Ran all test suites matching native-esm-native-module.test.js." `; exports[`runs WebAssembly (Wasm) test with native ESM 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 6 passed, 6 total Snapshots: 0 total Time: <> @@ -41,7 +41,7 @@ Ran all test suites matching native-esm-wasm.test.js." `; exports[`runs test with native ESM 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 33 passed, 33 total Snapshots: 0 total Time: <> @@ -49,7 +49,7 @@ 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 +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -57,7 +57,7 @@ Ran all test suites matching native-esm-core-cjs-reexport.test.js." `; exports[`supports top-level await 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/promiseAsyncHandling.test.ts.snap b/e2e/__tests__/__snapshots__/promiseAsyncHandling.test.ts.snap index 1ff8ca9e0dba..678f97fc722e 100644 --- a/e2e/__tests__/__snapshots__/promiseAsyncHandling.test.ts.snap +++ b/e2e/__tests__/__snapshots__/promiseAsyncHandling.test.ts.snap @@ -18,7 +18,7 @@ Object { 16 | }); at Object. (__tests__/unhandledRejectionAfterAll.test.js:13:18)", - "summary": "Test Suites: 1 failed, 1 total + "summary": "Test Suites: 1 failed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -59,7 +59,7 @@ Object { 16 | }); at Object. (__tests__/unhandledRejectionAfterEach.test.js:13:18)", - "summary": "Test Suites: 1 failed, 1 total + "summary": "Test Suites: 1 failed, 1 total (100%) Tests: 2 failed, 2 total Snapshots: 0 total Time: <> @@ -85,7 +85,7 @@ Object { 16 | }); at Object. (__tests__/unhandledRejectionBeforeAll.test.js:13:18)", - "summary": "Test Suites: 1 failed, 1 total + "summary": "Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 0 total Time: <> @@ -126,7 +126,7 @@ Object { 16 | }); at Object. (__tests__/unhandledRejectionBeforeEach.test.js:13:18)", - "summary": "Test Suites: 1 failed, 1 total + "summary": "Test Suites: 1 failed, 1 total (100%) Tests: 2 failed, 2 total Snapshots: 0 total Time: <> @@ -213,7 +213,7 @@ Object { 32 | at Object. (__tests__/unhandledRejectionTest.test.js:29:18)", - "summary": "Test Suites: 1 failed, 1 total + "summary": "Test Suites: 1 failed, 1 total (100%) Tests: 4 failed, 4 total Snapshots: 0 total Time: <> @@ -227,7 +227,7 @@ Object { ✓ async function succeeds because the promise is eventually awaited by assertion ✓ async function succeeds because the promise is eventually directly awaited ✓ sync function succeeds because the promise is eventually handled by \`.catch\` handler", - "summary": "Test Suites: 1 passed, 1 total + "summary": "Test Suites: 1 passed, 1 total (100%) Tests: 3 passed, 3 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/resolveAsync.test.ts.snap b/e2e/__tests__/__snapshots__/resolveAsync.test.ts.snap index edfad21176f6..ddeb42e6fcc9 100644 --- a/e2e/__tests__/__snapshots__/resolveAsync.test.ts.snap +++ b/e2e/__tests__/__snapshots__/resolveAsync.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`runs test with native ESM 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/runProgrammaticallyMultipleProjects.test.ts.snap b/e2e/__tests__/__snapshots__/runProgrammaticallyMultipleProjects.test.ts.snap index 9ffad72f23c0..daf3c410937f 100644 --- a/e2e/__tests__/__snapshots__/runProgrammaticallyMultipleProjects.test.ts.snap +++ b/e2e/__tests__/__snapshots__/runProgrammaticallyMultipleProjects.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`run programmatically with multiple projects: summary 1`] = ` -"Test Suites: 2 passed, 2 total +"Test Suites: 2 passed, 2 total (100%) Tests: 2 passed, 2 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/snapshot.test.ts.snap b/e2e/__tests__/__snapshots__/snapshot.test.ts.snap index e6d85efff184..a6183d3dc497 100644 --- a/e2e/__tests__/__snapshots__/snapshot.test.ts.snap +++ b/e2e/__tests__/__snapshots__/snapshot.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Snapshot Validation deletes a snapshot when a test does removes all the snapshots 1`] = ` -"Test Suites: 3 passed, 3 total +"Test Suites: 3 passed, 3 total (100%) Tests: 9 passed, 9 total Snapshots: 9 written, 9 total Time: <> @@ -9,7 +9,7 @@ Ran all test suites." `; exports[`Snapshot Validation deletes a snapshot when a test does removes all the snapshots 2`] = ` -"Test Suites: 3 passed, 3 total +"Test Suites: 3 passed, 3 total (100%) Tests: 6 passed, 6 total Snapshots: 1 file removed, 5 passed, 5 total Time: <> @@ -17,7 +17,7 @@ Ran all test suites." `; exports[`Snapshot Validation deletes the snapshot if the test suite has been removed 1`] = ` -"Test Suites: 3 passed, 3 total +"Test Suites: 3 passed, 3 total (100%) Tests: 9 passed, 9 total Snapshots: 9 written, 9 total Time: <> @@ -25,7 +25,7 @@ Ran all test suites." `; exports[`Snapshot Validation deletes the snapshot if the test suite has been removed 2`] = ` -"Test Suites: 2 passed, 2 total +"Test Suites: 2 passed, 2 total (100%) Tests: 5 passed, 5 total Snapshots: 1 file removed, 5 passed, 5 total Time: <> @@ -33,7 +33,7 @@ Ran all test suites." `; exports[`Snapshot Validation does not save snapshots in CI mode by default 1`] = ` -"Test Suites: 3 failed, 3 total +"Test Suites: 3 failed, 3 total (100%) Tests: 7 failed, 2 passed, 9 total Snapshots: 9 failed, 9 total Time: <> @@ -41,7 +41,7 @@ Ran all test suites." `; exports[`Snapshot Validation updates the snapshot when a test removes some snapshots 1`] = ` -"Test Suites: 3 passed, 3 total +"Test Suites: 3 passed, 3 total (100%) Tests: 9 passed, 9 total Snapshots: 9 written, 9 total Time: <> @@ -49,7 +49,7 @@ Ran all test suites." `; exports[`Snapshot Validation updates the snapshot when a test removes some snapshots 2`] = ` -"Test Suites: 3 passed, 3 total +"Test Suites: 3 passed, 3 total (100%) Tests: 9 passed, 9 total Snapshots: 1 removed, 1 updated, 7 passed, 8 total Time: <> @@ -57,7 +57,7 @@ Ran all test suites." `; exports[`Snapshot Validation works on subsequent runs without \`-u\` 1`] = ` -"Test Suites: 3 passed, 3 total +"Test Suites: 3 passed, 3 total (100%) Tests: 9 passed, 9 total Snapshots: 9 written, 9 total Time: <> @@ -65,7 +65,7 @@ Ran all test suites." `; exports[`Snapshot Validation works on subsequent runs without \`-u\` 2`] = ` -"Test Suites: 3 passed, 3 total +"Test Suites: 3 passed, 3 total (100%) Tests: 9 passed, 9 total Snapshots: 9 passed, 9 total Time: <> @@ -73,7 +73,7 @@ Ran all test suites." `; exports[`Snapshot stores new snapshots on the first run 1`] = ` -"Test Suites: 2 passed, 2 total +"Test Suites: 2 passed, 2 total (100%) Tests: 5 passed, 5 total Snapshots: 5 written, 5 total Time: <> @@ -81,7 +81,7 @@ Ran all test suites." `; exports[`Snapshot works with escaped characters 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 1 written, 1 total Time: <> @@ -89,7 +89,7 @@ Ran all test suites matching snapshot.test.js." `; exports[`Snapshot works with escaped characters 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 2 passed, 2 total Snapshots: 1 written, 1 passed, 2 total Time: <> @@ -97,7 +97,7 @@ Ran all test suites matching snapshot.test.js." `; exports[`Snapshot works with escaped characters 3`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 2 passed, 2 total Snapshots: 2 passed, 2 total Time: <> @@ -105,7 +105,7 @@ Ran all test suites matching snapshot.test.js." `; exports[`Snapshot works with escaped regex 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 2 passed, 2 total Snapshots: 2 written, 2 total Time: <> @@ -113,7 +113,7 @@ Ran all test suites matching snapshotEscapeRegex.js." `; exports[`Snapshot works with escaped regex 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 2 passed, 2 total Snapshots: 2 passed, 2 total Time: <> @@ -121,7 +121,7 @@ Ran all test suites matching snapshotEscapeRegex.js." `; exports[`Snapshot works with template literal substitutions 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 1 written, 1 total Time: <> @@ -129,7 +129,7 @@ Ran all test suites matching snapshotEscapeSubstitution.test.js." `; exports[`Snapshot works with template literal substitutions 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 1 passed, 1 total Time: <> diff --git a/e2e/__tests__/__snapshots__/snapshotMockFs.test.ts.snap b/e2e/__tests__/__snapshots__/snapshotMockFs.test.ts.snap index 0b187ca45889..768ed21207ad 100644 --- a/e2e/__tests__/__snapshots__/snapshotMockFs.test.ts.snap +++ b/e2e/__tests__/__snapshots__/snapshotMockFs.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`store snapshot even if fs is mocked 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 1 written, 1 total Time: <> diff --git a/e2e/__tests__/__snapshots__/stackTrace.test.ts.snap b/e2e/__tests__/__snapshots__/stackTrace.test.ts.snap index ecc0b1cbf61c..e7d8f4b48dea 100644 --- a/e2e/__tests__/__snapshots__/stackTrace.test.ts.snap +++ b/e2e/__tests__/__snapshots__/stackTrace.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Stack Trace does not print a stack trace for errors when --noStackTrace is given 1`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 3 failed, 3 total Snapshots: 0 total Time: <> @@ -9,7 +9,7 @@ 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 +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 0 total Time: <> @@ -17,7 +17,7 @@ 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 +"Test Suites: 1 failed, 1 total (100%) Tests: 0 total Snapshots: 0 total Time: <> @@ -25,7 +25,7 @@ Ran all test suites matching runtimeError.test.js." `; exports[`Stack Trace prints a stack trace for errors 1`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 3 failed, 3 total Snapshots: 0 total Time: <> @@ -33,7 +33,7 @@ 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 +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 0 total Time: <> @@ -41,7 +41,7 @@ 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 +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 0 total Time: <> @@ -49,7 +49,7 @@ 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 +"Test Suites: 1 failed, 1 total (100%) Tests: 0 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/testMatch.test.ts.snap b/e2e/__tests__/__snapshots__/testMatch.test.ts.snap index ed8312fe8a59..138bff40f749 100644 --- a/e2e/__tests__/__snapshots__/testMatch.test.ts.snap +++ b/e2e/__tests__/__snapshots__/testMatch.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`testMatch should able to match file with cjs and mjs extension 1`] = ` -"Test Suites: 2 passed, 2 total +"Test Suites: 2 passed, 2 total (100%) Tests: 2 passed, 2 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/testMatchDefault.test.ts.snap b/e2e/__tests__/__snapshots__/testMatchDefault.test.ts.snap index 85aafe3318c3..6c05363fa974 100644 --- a/e2e/__tests__/__snapshots__/testMatchDefault.test.ts.snap +++ b/e2e/__tests__/__snapshots__/testMatchDefault.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`testMatch should able to match file with \`?([mc])[jt]s?(x)\` by default 1`] = ` -"Test Suites: 16 passed, 16 total +"Test Suites: 16 passed, 16 total (100%) Tests: 16 passed, 16 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/testMatchTs.test.ts.snap b/e2e/__tests__/__snapshots__/testMatchTs.test.ts.snap index 9af319324f07..74b637c3a292 100644 --- a/e2e/__tests__/__snapshots__/testMatchTs.test.ts.snap +++ b/e2e/__tests__/__snapshots__/testMatchTs.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`testMatch should able to match file with cts and mts extension 1`] = ` -"Test Suites: 2 passed, 2 total +"Test Suites: 2 passed, 2 total (100%) Tests: 2 passed, 2 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/testNamePattern.test.ts.snap b/e2e/__tests__/__snapshots__/testNamePattern.test.ts.snap index 9c72df9c12dd..f4d7d69cd1eb 100644 --- a/e2e/__tests__/__snapshots__/testNamePattern.test.ts.snap +++ b/e2e/__tests__/__snapshots__/testNamePattern.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`testNamePattern 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 3 skipped, 2 passed, 5 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/testNamePatternSkipped.test.ts.snap b/e2e/__tests__/__snapshots__/testNamePatternSkipped.test.ts.snap index fb6226de5485..98685a05dd23 100644 --- a/e2e/__tests__/__snapshots__/testNamePatternSkipped.test.ts.snap +++ b/e2e/__tests__/__snapshots__/testNamePatternSkipped.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`testNamePattern skipped 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 skipped, 1 passed, 2 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/testTodo.test.ts.snap b/e2e/__tests__/__snapshots__/testTodo.test.ts.snap index 3f5f1d950276..926418622fab 100644 --- a/e2e/__tests__/__snapshots__/testTodo.test.ts.snap +++ b/e2e/__tests__/__snapshots__/testTodo.test.ts.snap @@ -7,7 +7,7 @@ exports[`counts todo tests when inside of a \`describe.only\` 1`] = ` ✎ todo todo test 1 ✎ todo todo test 2 -Test Suites: 1 passed, 1 total +Test Suites: 1 passed, 1 total (100%) Tests: 2 todo, 1 passed, 3 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/timeouts.test.ts.snap b/e2e/__tests__/__snapshots__/timeouts.test.ts.snap index b68b979b731b..83b1f826b8a5 100644 --- a/e2e/__tests__/__snapshots__/timeouts.test.ts.snap +++ b/e2e/__tests__/__snapshots__/timeouts.test.ts.snap @@ -6,7 +6,7 @@ exports[`does not exceed the command line testTimeout 1`] = ` `; exports[`does not exceed the command line testTimeout 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -19,7 +19,7 @@ exports[`does not exceed the timeout 1`] = ` `; exports[`does not exceed the timeout 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -32,7 +32,7 @@ exports[`does not exceed the timeout parameter 1`] = ` `; exports[`does not exceed the timeout parameter 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -40,7 +40,7 @@ Ran all test suites." `; exports[`exceeds the command line testTimeout 1`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 0 total Time: <> @@ -48,7 +48,7 @@ Ran all test suites." `; exports[`exceeds the timeout 1`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 0 total Time: <> @@ -56,7 +56,7 @@ Ran all test suites." `; exports[`exceeds the timeout parameter 1`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 0 total Time: <> @@ -64,7 +64,7 @@ Ran all test suites." `; exports[`exceeds the timeout specifying that \`done\` has not been called 1`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/watchModeOnlyFailed.test.ts.snap b/e2e/__tests__/__snapshots__/watchModeOnlyFailed.test.ts.snap index 1eb721361319..312a2a72d1fc 100644 --- a/e2e/__tests__/__snapshots__/watchModeOnlyFailed.test.ts.snap +++ b/e2e/__tests__/__snapshots__/watchModeOnlyFailed.test.ts.snap @@ -35,7 +35,7 @@ exports[`can press "f" to run only failed tests: test results 2`] = ` `; exports[`can press "f" to run only failed tests: test summary 1`] = ` -"Test Suites: 1 failed, 1 passed, 2 total +"Test Suites: 1 failed, 1 passed, 2 total (100%) Tests: 1 failed, 1 passed, 2 total Snapshots: 0 total Time: <> @@ -43,7 +43,7 @@ Ran all test suites." `; exports[`can press "f" to run only failed tests: test summary 2`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/watchModePatterns.test.ts.snap b/e2e/__tests__/__snapshots__/watchModePatterns.test.ts.snap index 185caf8c8f20..b0b6a3db0646 100644 --- a/e2e/__tests__/__snapshots__/watchModePatterns.test.ts.snap +++ b/e2e/__tests__/__snapshots__/watchModePatterns.test.ts.snap @@ -54,7 +54,7 @@ exports[`can press "p" to filter by file name: test results 2`] = ` `; exports[`can press "p" to filter by file name: test summary 1`] = ` -"Test Suites: 2 passed, 2 total +"Test Suites: 2 passed, 2 total (100%) Tests: 4 passed, 4 total Snapshots: 0 total Time: <> @@ -62,7 +62,7 @@ Ran all test suites." `; exports[`can press "p" to filter by file name: test summary 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 2 passed, 2 total Snapshots: 0 total Time: <> @@ -108,7 +108,7 @@ PASS __tests__/foo.spec.js" `; exports[`can press "t" to filter by test name: test summary 1`] = ` -"Test Suites: 2 passed, 2 total +"Test Suites: 2 passed, 2 total (100%) Tests: 4 passed, 4 total Snapshots: 0 total Time: <> @@ -116,7 +116,7 @@ Ran all test suites." `; exports[`can press "t" to filter by test name: test summary 2`] = ` -"Test Suites: 2 passed, 2 total +"Test Suites: 2 passed, 2 total (100%) Tests: 2 skipped, 2 passed, 4 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/watchModeUpdateSnapshot.test.ts.snap b/e2e/__tests__/__snapshots__/watchModeUpdateSnapshot.test.ts.snap index f13279f7e2b1..a38c16d42844 100644 --- a/e2e/__tests__/__snapshots__/watchModeUpdateSnapshot.test.ts.snap +++ b/e2e/__tests__/__snapshots__/watchModeUpdateSnapshot.test.ts.snap @@ -33,7 +33,7 @@ Snapshot Summary `; exports[`can press "u" to update snapshots: test summary 1`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 1 failed, 1 total Time: <> @@ -41,7 +41,7 @@ Ran all test suites." `; exports[`can press "u" to update snapshots: test summary 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 1 updated, 1 total Time: <> diff --git a/e2e/__tests__/__snapshots__/workerRestartBeforeSend.test.ts.snap b/e2e/__tests__/__snapshots__/workerRestartBeforeSend.test.ts.snap index 33a283aa2937..721d2100f77e 100644 --- a/e2e/__tests__/__snapshots__/workerRestartBeforeSend.test.ts.snap +++ b/e2e/__tests__/__snapshots__/workerRestartBeforeSend.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`all 3 test files should complete 1`] = ` -"Test Suites: 1 failed, 2 passed, 3 total +"Test Suites: 1 failed, 2 passed, 3 total (100%) Tests: 2 passed, 2 total Snapshots: 0 total Time: <> diff --git a/e2e/__tests__/__snapshots__/workerRestarting.test.ts.snap b/e2e/__tests__/__snapshots__/workerRestarting.test.ts.snap index edf50a0f2d69..58d3e08b3bbe 100644 --- a/e2e/__tests__/__snapshots__/workerRestarting.test.ts.snap +++ b/e2e/__tests__/__snapshots__/workerRestarting.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`all 3 test files should complete 1`] = ` -"Test Suites: 3 passed, 3 total +"Test Suites: 3 passed, 3 total (100%) Tests: 3 passed, 3 total Snapshots: 0 total Time: <> diff --git a/packages/jest-reporters/src/__tests__/__snapshots__/SummaryReporter.test.js.snap b/packages/jest-reporters/src/__tests__/__snapshots__/SummaryReporter.test.js.snap index 60b44ee0f551..3ea8f76d3d85 100644 --- a/packages/jest-reporters/src/__tests__/__snapshots__/SummaryReporter.test.js.snap +++ b/packages/jest-reporters/src/__tests__/__snapshots__/SummaryReporter.test.js.snap @@ -10,7 +10,7 @@ exports[`snapshots all have results (after update) 1`] = ` ↳ ../path/to/suite_one • unchecked snapshot 1 -Test Suites: 1 failed, 1 total +Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 1 failed, 1 removed, 1 file removed, 1 updated, 1 written, 2 passed, 2 total Time: 0.01 s @@ -28,7 +28,7 @@ exports[`snapshots all have results (no update) 1`] = ` ↳ ../path/to/suite_one • unchecked snapshot 1 -Test Suites: 1 failed, 1 total +Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 1 failed, 1 obsolete, 1 file obsolete, 1 updated, 1 written, 2 passed, 2 total Time: 0.01 s @@ -40,7 +40,7 @@ exports[`snapshots needs update with npm test 1`] = ` "Snapshot Summary › 2 snapshots failed from 1 test suite. Inspect your code changes or run \`npm test -- -u\` to update them. -Test Suites: 1 failed, 1 total +Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 2 failed, 2 total Time: 0.01 s @@ -52,7 +52,7 @@ exports[`snapshots needs update with yarn test 1`] = ` "Snapshot Summary › 2 snapshots failed from 1 test suite. Inspect your code changes or run \`yarn test -u\` to update them. -Test Suites: 1 failed, 1 total +Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 2 failed, 2 total Time: 0.01 s @@ -61,7 +61,7 @@ exports[`snapshots needs update with yarn test 1`] = ` `; exports[`summaryThreshold option Should not print failure messages when number of test suites is equal to the threshold 1`] = ` -"Test Suites: 1 failed, 2 passed, 3 total +"Test Suites: 1 failed, 2 passed, 3 total (100%) Tests: 1 failed, 3 total Snapshots: 0 total Time: 0.01 s @@ -70,7 +70,7 @@ exports[`summaryThreshold option Should not print failure messages when number o `; exports[`summaryThreshold option Should not print failure messages when number of test suites is under the threshold 1`] = ` -"Test Suites: 1 failed, 2 passed, 3 total +"Test Suites: 1 failed, 2 passed, 3 total (100%) Tests: 1 failed, 3 total Snapshots: 0 total Time: 0.01 s @@ -85,7 +85,7 @@ FailureMessage1 FAIL ../path2 FailureMessage2 -Test Suites: 1 failed, 2 passed, 3 total +Test Suites: 1 failed, 2 passed, 3 total (100%) Tests: 1 failed, 3 total Snapshots: 0 total Time: 0.01 s diff --git a/packages/jest-reporters/src/__tests__/__snapshots__/getSummary.test.ts.snap b/packages/jest-reporters/src/__tests__/__snapshots__/getSummary.test.ts.snap index 00e39eced7a2..969a865d8713 100644 --- a/packages/jest-reporters/src/__tests__/__snapshots__/getSummary.test.ts.snap +++ b/packages/jest-reporters/src/__tests__/__snapshots__/getSummary.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`getSummary does not print seed value when showSeed is false 1`] = ` -"Test Suites: 0 total +"Test Suites: 0 total (100%) Tests: 0 total Snapshots: 0 total Time: 0.01 s" @@ -9,7 +9,7 @@ exports[`getSummary does not print seed value when showSeed is false 1`] = ` exports[`getSummary does print seed value when showSeed is true 1`] = ` "Seed: 55555 -Test Suites: 0 total +Test Suites: 0 total (100%) Tests: 0 total Snapshots: 0 total Time: 0.01 s" From bbff0d30d76b5e88ebb34ed1d1b32c13316ece21 Mon Sep 17 00:00:00 2001 From: Willian Agostini Date: Tue, 9 Jan 2024 02:30:13 +0000 Subject: [PATCH 3/7] test: update JEST snapshots --- e2e/__tests__/__snapshots__/timeoutsLegacy.test.ts.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/__tests__/__snapshots__/timeoutsLegacy.test.ts.snap b/e2e/__tests__/__snapshots__/timeoutsLegacy.test.ts.snap index 1f76f9f4b47f..cfeb4242ad16 100644 --- a/e2e/__tests__/__snapshots__/timeoutsLegacy.test.ts.snap +++ b/e2e/__tests__/__snapshots__/timeoutsLegacy.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`can read and write jasmine.DEFAULT_TIMEOUT_INTERVAL 1`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -14,7 +14,7 @@ exports[`does not exceed the timeout using jasmine.DEFAULT_TIMEOUT_INTERVAL 1`] `; exports[`does not exceed the timeout using jasmine.DEFAULT_TIMEOUT_INTERVAL 2`] = ` -"Test Suites: 1 passed, 1 total +"Test Suites: 1 passed, 1 total (100%) Tests: 1 passed, 1 total Snapshots: 0 total Time: <> @@ -22,7 +22,7 @@ Ran all test suites." `; exports[`exceeds the timeout set using jasmine.DEFAULT_TIMEOUT_INTERVAL 1`] = ` -"Test Suites: 1 failed, 1 total +"Test Suites: 1 failed, 1 total (100%) Tests: 1 failed, 1 total Snapshots: 0 total Time: <> From 222a6468f7972c41f52dd068aa1d711d0b7a1fc1 Mon Sep 17 00:00:00 2001 From: Willian Agostini Date: Thu, 11 Jan 2024 22:42:41 -0300 Subject: [PATCH 4/7] feat: add message sutesPassed on running tests --- packages/jest-reporters/src/Status.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/jest-reporters/src/Status.ts b/packages/jest-reporters/src/Status.ts index 8659c6e750c0..3f1d09cf9bc2 100644 --- a/packages/jest-reporters/src/Status.ts +++ b/packages/jest-reporters/src/Status.ts @@ -171,11 +171,18 @@ export default class Status { : ''; const prefix = RUNNING + projectDisplayName; + const suitesPassed = this._currentTestCases.filter( + c => c.testCaseResult.status == 'passed' && c.test.path === testPath, + ).length; + + const currentTestPassed = `${chalk.bold.green( + `${suitesPassed} passed`, + )}`; content += `${wrapAnsiString( prefix + trimAndFormatPath(stringLength(prefix), config, testPath, width), width, - )}\n`; + )} ${currentTestPassed}\n`; } } From f6a5d5dda1e92cd08f13f4c47c42fcb503d23909 Mon Sep 17 00:00:00 2001 From: Willian Agostini Date: Thu, 11 Jan 2024 23:05:57 -0300 Subject: [PATCH 5/7] perf: add passedTests in CurrentTestList object --- packages/jest-reporters/src/Status.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/jest-reporters/src/Status.ts b/packages/jest-reporters/src/Status.ts index 3f1d09cf9bc2..f6b407df7eb1 100644 --- a/packages/jest-reporters/src/Status.ts +++ b/packages/jest-reporters/src/Status.ts @@ -32,6 +32,7 @@ class CurrentTestList { private _array: Array<{ testPath: string; config: Config.ProjectConfig; + passedTests: number; } | null>; constructor() { @@ -40,7 +41,8 @@ class CurrentTestList { add(testPath: string, config: Config.ProjectConfig) { const index = this._array.indexOf(null); - const record = {config, testPath}; + const passedTests = 0; + const record = {config, passedTests, testPath}; if (index === -1) { this._array.push(record); } else { @@ -48,6 +50,11 @@ class CurrentTestList { } } + addPassedTest(path: string) { + const record = this._array.find(record => record?.testPath === path); + if (record) record.passedTests++; + } + delete(testPath: string) { const record = this._array.find( record => record !== null && record.testPath === testPath, @@ -123,6 +130,8 @@ export default class Status { } else { this._emit(); } + if (testCaseResult.status == 'passed') + this._currentTests.addPassedTest(test.path); } testStarted(testPath: string, config: Config.ProjectConfig): void { @@ -164,19 +173,15 @@ export default class Status { let content = '\n'; for (const record of this._currentTests.get()) { if (record) { - const {config, testPath} = record; + const {config, testPath, passedTests} = record; const projectDisplayName = config.displayName ? `${printDisplayName(config)} ` : ''; const prefix = RUNNING + projectDisplayName; - const suitesPassed = this._currentTestCases.filter( - c => c.testCaseResult.status == 'passed' && c.test.path === testPath, - ).length; - const currentTestPassed = `${chalk.bold.green( - `${suitesPassed} passed`, + `${passedTests} passed`, )}`; content += `${wrapAnsiString( prefix + From 3ce02b056158df7c7719f1491bf737eb95fae4d6 Mon Sep 17 00:00:00 2001 From: Willian Agostini Date: Wed, 17 Jan 2024 21:41:14 -0300 Subject: [PATCH 6/7] feat: add message of total tests to run --- .../legacy-code-todo-rewrite/jestAdapter.ts | 1 + .../jestAdapterInit.ts | 28 +++++++++++++++++++ packages/jest-core/src/ReporterDispatcher.ts | 11 ++++++++ packages/jest-core/src/TestScheduler.ts | 6 ++++ packages/jest-jasmine2/src/index.ts | 10 +++++-- packages/jest-jasmine2/src/reporter.ts | 13 +++++++-- packages/jest-reporters/src/BaseReporter.ts | 2 ++ .../jest-reporters/src/DefaultReporter.ts | 4 +++ packages/jest-reporters/src/Status.ts | 14 +++++++++- packages/jest-reporters/src/types.ts | 4 +++ packages/jest-test-result/src/types.ts | 1 + 11 files changed, 89 insertions(+), 5 deletions(-) diff --git a/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts b/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts index e80bbfba4809..dd02cb5a0d95 100644 --- a/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts +++ b/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapter.ts @@ -104,6 +104,7 @@ const jestAdapter = async ( const results = await runAndTransformResultsToJestFormat({ config, globalConfig, + sendMessageToJest, setupAfterEnvPerfStats, testPath, }); diff --git a/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapterInit.ts b/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapterInit.ts index 5c71ce1aafa4..fbf2f3e8fc39 100644 --- a/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapterInit.ts +++ b/packages/jest-circus/src/legacy-code-todo-rewrite/jestAdapterInit.ts @@ -30,6 +30,7 @@ import { addEventHandler, dispatch, getState as getRunnerState, + getState, } from '../state'; import testCaseReportHandler from '../testCaseReportHandler'; import {unhandledRejectionHandler} from '../unhandledRejectionHandler'; @@ -143,17 +144,44 @@ export const initialize = async ({ return {globals: globalsObject, snapshotState}; }; +const countNumberOfTests = (describeBlock: Circus.DescribeBlock) => { + let numberOfTests = 0; + + for (const child of describeBlock.children) { + switch (child.type) { + case 'describeBlock': + numberOfTests += countNumberOfTests(child); + break; + + case 'test': + numberOfTests++; + break; + } + } + + return numberOfTests; +}; + export const runAndTransformResultsToJestFormat = async ({ config, globalConfig, + sendMessageToJest, setupAfterEnvPerfStats, testPath, }: { config: Config.ProjectConfig; globalConfig: Config.GlobalConfig; + sendMessageToJest?: TestFileEvent; testPath: string; setupAfterEnvPerfStats: Config.SetupAfterEnvPerfStats; }): Promise => { + const {rootDescribeBlock} = getState(); + if (sendMessageToJest) + sendMessageToJest('test-file-num-of-tests', [ + testPath, + countNumberOfTests(rootDescribeBlock), + ]); + const runResult: Circus.RunResult = await run(); let numFailingTests = 0; diff --git a/packages/jest-core/src/ReporterDispatcher.ts b/packages/jest-core/src/ReporterDispatcher.ts index 451bb5bd6102..212e15543f22 100644 --- a/packages/jest-core/src/ReporterDispatcher.ts +++ b/packages/jest-core/src/ReporterDispatcher.ts @@ -92,6 +92,17 @@ export default class ReporterDispatcher { } } + async onNumberOfTests( + testPath: string, + numberOfTests: number, + ): Promise { + for (const reporter of this._reporters) { + if (reporter.onNumberOfTests) { + await reporter.onNumberOfTests(testPath, numberOfTests); + } + } + } + async onRunComplete( testContexts: Set, results: AggregatedResult, diff --git a/packages/jest-core/src/TestScheduler.ts b/packages/jest-core/src/TestScheduler.ts index 090b650f55a7..1fcee8a45a40 100644 --- a/packages/jest-core/src/TestScheduler.ts +++ b/packages/jest-core/src/TestScheduler.ts @@ -272,6 +272,12 @@ class TestScheduler { this._dispatcher.onTestCaseResult(test, testCaseResult); }, ), + testRunner.on( + 'test-file-num-of-tests', + ([testPath, numberOfTests]) => { + this._dispatcher.onNumberOfTests(testPath, numberOfTests); + }, + ), ]; await testRunner.runTests(tests, watcher, testRunnerOptions); diff --git a/packages/jest-jasmine2/src/index.ts b/packages/jest-jasmine2/src/index.ts index 00562172fff9..b0ac94b372ff 100644 --- a/packages/jest-jasmine2/src/index.ts +++ b/packages/jest-jasmine2/src/index.ts @@ -8,7 +8,7 @@ import * as path from 'path'; import type {JestEnvironment} from '@jest/environment'; import {getCallsite} from '@jest/source-map'; -import type {TestResult} from '@jest/test-result'; +import type {TestFileEvent, TestResult} from '@jest/test-result'; import type {Config, Global} from '@jest/types'; import type Runtime from 'jest-runtime'; import type {SnapshotState} from 'jest-snapshot'; @@ -31,8 +31,14 @@ export default async function jasmine2( environment: JestEnvironment, runtime: Runtime, testPath: string, + sendMessageToJest?: TestFileEvent, ): Promise { - const reporter = new JasmineReporter(globalConfig, config, testPath); + const reporter = new JasmineReporter( + globalConfig, + config, + testPath, + sendMessageToJest, + ); const jasmineFactory = runtime.requireInternalModule( JASMINE, diff --git a/packages/jest-jasmine2/src/reporter.ts b/packages/jest-jasmine2/src/reporter.ts index 4182b370cc3d..1fb53e1afd20 100644 --- a/packages/jest-jasmine2/src/reporter.ts +++ b/packages/jest-jasmine2/src/reporter.ts @@ -7,6 +7,7 @@ import { type AssertionResult, + type TestFileEvent, type TestResult, createEmptyTestResult, } from '@jest/test-result'; @@ -27,11 +28,13 @@ export default class Jasmine2Reporter implements Reporter { private readonly _resultsPromise: Promise; private readonly _startTimes: Map; private readonly _testPath: string; + private readonly _sendMessageToJest?: TestFileEvent; constructor( globalConfig: Config.GlobalConfig, config: Config.ProjectConfig, testPath: string, + sendMessageToJest?: TestFileEvent, ) { this._globalConfig = globalConfig; this._config = config; @@ -41,10 +44,16 @@ export default class Jasmine2Reporter implements Reporter { this._resolve = null; this._resultsPromise = new Promise(resolve => (this._resolve = resolve)); this._startTimes = new Map(); + this._sendMessageToJest = sendMessageToJest; } - // eslint-disable-next-line @typescript-eslint/no-empty-function - jasmineStarted(_runDetails: RunDetails): void {} + jasmineStarted(_runDetails: RunDetails): void { + if (this._sendMessageToJest && _runDetails.totalSpecsDefined !== undefined) + this._sendMessageToJest('test-file-num-of-tests', [ + this._testPath, + _runDetails.totalSpecsDefined, + ]); + } specStarted(spec: SpecResult): void { this._startTimes.set(spec.id, Date.now()); diff --git a/packages/jest-reporters/src/BaseReporter.ts b/packages/jest-reporters/src/BaseReporter.ts index 1e9f12a0e8e7..cd35aa21f11e 100644 --- a/packages/jest-reporters/src/BaseReporter.ts +++ b/packages/jest-reporters/src/BaseReporter.ts @@ -34,6 +34,8 @@ export default class BaseReporter implements Reporter { /* eslint-disable @typescript-eslint/no-empty-function */ onTestCaseResult(_test: Test, _testCaseResult: TestCaseResult): void {} + onNumberOfTests(_testPath: string, _numberOfTests: number): void {} + onTestResult( _test?: Test, _testResult?: TestResult, diff --git a/packages/jest-reporters/src/DefaultReporter.ts b/packages/jest-reporters/src/DefaultReporter.ts index 288aafb26bd9..e2035a4bb13e 100644 --- a/packages/jest-reporters/src/DefaultReporter.ts +++ b/packages/jest-reporters/src/DefaultReporter.ts @@ -147,6 +147,10 @@ export default class DefaultReporter extends BaseReporter { this._status.addTestCaseResult(test, testCaseResult); } + override onNumberOfTests(testPath: string, numberOfTests: number): void { + this._status.addNumberOfTests(testPath, numberOfTests); + } + override onRunComplete(): void { this.forceFlushBufferedOutput(); this._status.runFinished(); diff --git a/packages/jest-reporters/src/Status.ts b/packages/jest-reporters/src/Status.ts index f6b407df7eb1..f36ed86773e2 100644 --- a/packages/jest-reporters/src/Status.ts +++ b/packages/jest-reporters/src/Status.ts @@ -91,6 +91,7 @@ export default class Status { private _interval?: NodeJS.Timeout; private _aggregatedResults?: AggregatedResult; private _showStatus: boolean; + private _numberOfTests: Map; constructor(private readonly _globalConfig: Config.GlobalConfig) { this._cache = null; @@ -100,6 +101,7 @@ export default class Status { this._emitScheduled = false; this._estimatedTime = 0; this._showStatus = false; + this._numberOfTests = new Map(); } onChange(callback: () => void): void { @@ -134,6 +136,14 @@ export default class Status { this._currentTests.addPassedTest(test.path); } + addNumberOfTests(testPath: string, numberOfTests: number): void { + this._numberOfTests.set(testPath, numberOfTests); + } + + getNumberOfTests(testPath: string): number | undefined { + return this._numberOfTests.get(testPath); + } + testStarted(testPath: string, config: Config.ProjectConfig): void { this._currentTests.add(testPath, config); if (this._showStatus) { @@ -180,8 +190,10 @@ export default class Status { : ''; const prefix = RUNNING + projectDisplayName; + const numberOfTests = this.getNumberOfTests(testPath); + const txtNumberOfTests = numberOfTests ? `of ${numberOfTests}` : ''; const currentTestPassed = `${chalk.bold.green( - `${passedTests} passed`, + `${passedTests} passed ${txtNumberOfTests}`, )}`; content += `${wrapAnsiString( prefix + diff --git a/packages/jest-reporters/src/types.ts b/packages/jest-reporters/src/types.ts index a33e6ddd4f65..0f7951b9179e 100644 --- a/packages/jest-reporters/src/types.ts +++ b/packages/jest-reporters/src/types.ts @@ -42,6 +42,10 @@ export interface Reporter { test: Test, testCaseResult: TestCaseResult, ) => Promise | void; + readonly onNumberOfTests?: ( + testPath: string, + numberOfTests: number, + ) => Promise | void; readonly onRunStart?: ( results: AggregatedResult, options: ReporterOnStartOptions, diff --git a/packages/jest-test-result/src/types.ts b/packages/jest-test-result/src/types.ts index 7200d5a73da8..5f0ed91f4eb8 100644 --- a/packages/jest-test-result/src/types.ts +++ b/packages/jest-test-result/src/types.ts @@ -205,6 +205,7 @@ export type TestContext = { // Typings for `sendMessageToJest` events export type TestEvents = { + 'test-file-num-of-tests': [string, number]; 'test-file-start': [Test]; 'test-file-success': [Test, TestResult]; 'test-file-failure': [Test, SerializableError]; From d250268f0d10913b783953b181e7599aed4e875c Mon Sep 17 00:00:00 2001 From: Willian Agostini Date: Thu, 18 Jan 2024 00:11:57 -0300 Subject: [PATCH 7/7] Test