MCPcopy
hub / github.com/jestjs/jest / _printSummary

Method _printSummary

packages/jest-reporters/src/SummaryReporter.ts:185–208  ·  view source on GitHub ↗
(
    aggregatedResults: AggregatedResult,
    globalConfig: Config.GlobalConfig,
  )

Source from the content-addressed store, hash-verified

183 }
184
185 private _printSummary(
186 aggregatedResults: AggregatedResult,
187 globalConfig: Config.GlobalConfig,
188 ) {
189 // If there were any failing tests and there was a large number of tests
190 // executed, re-print the failing results at the end of execution output.
191 const failedTests = aggregatedResults.numFailedTests;
192 const runtimeErrors = aggregatedResults.numRuntimeErrorTestSuites;
193 if (
194 failedTests + runtimeErrors > 0 &&
195 aggregatedResults.numTotalTestSuites > this._summaryThreshold
196 ) {
197 this.log(chalk.bold('Summary of all failing tests'));
198 for (const testResult of aggregatedResults.testResults) {
199 const {failureMessage} = testResult;
200 if (failureMessage) {
201 this._write(
202 `${getResultHeader(testResult, globalConfig)}\n${failureMessage}\n`,
203 );
204 }
205 }
206 this.log(''); // print empty line
207 }
208 }
209
210 private _getTestSummary(
211 testContexts: Set<TestContext>,

Callers 1

onRunCompleteMethod · 0.95

Calls 3

_writeMethod · 0.95
getResultHeaderFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected