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

Function getValuesCurrentTestCases

packages/jest-reporters/src/getSummary.ts:15–52  ·  view source on GitHub ↗
(
  currentTestCases: Array<{test: Test; testCaseResult: TestCaseResult}> = [],
)

Source from the content-addressed store, hash-verified

13export const PROGRESS_BAR_WIDTH = 40;
14
15function getValuesCurrentTestCases(
16 currentTestCases: Array<{test: Test; testCaseResult: TestCaseResult}> = [],
17) {
18 let numFailingTests = 0;
19 let numPassingTests = 0;
20 let numPendingTests = 0;
21 let numTodoTests = 0;
22 let numTotalTests = 0;
23 for (const testCase of currentTestCases) {
24 switch (testCase.testCaseResult.status) {
25 case 'failed': {
26 numFailingTests++;
27 break;
28 }
29 case 'passed': {
30 numPassingTests++;
31 break;
32 }
33 case 'skipped': {
34 numPendingTests++;
35 break;
36 }
37 case 'todo': {
38 numTodoTests++;
39 break;
40 }
41 }
42 numTotalTests++;
43 }
44
45 return {
46 numFailingTests,
47 numPassingTests,
48 numPendingTests,
49 numTodoTests,
50 numTotalTests,
51 };
52}
53
54function renderTime(runTime: number, estimatedTime: number, width: number) {
55 // If we are more than one second over the estimated time, highlight it.

Callers 1

getSummaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected