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

Function printCollectedTestTree

packages/jest-core/src/runJest.ts:43–60  ·  view source on GitHub ↗
(
  testResults: Array<AssertionResult>,
  outputStream: NodeJS.WritableStream,
)

Source from the content-addressed store, hash-verified

41import type {Filter, TestRunData} from './types';
42
43export const printCollectedTestTree = (
44 testResults: Array<AssertionResult>,
45 outputStream: NodeJS.WritableStream,
46): void => {
47 const printSuite = (suite: Suite, indent: number): void => {
48 if (suite.title) {
49 outputStream.write(`${' '.repeat(indent)}${suite.title}\n`);
50 }
51 for (const t of suite.tests) {
52 outputStream.write(`${' '.repeat(indent + 1)}${t.title}\n`);
53 }
54 for (const child of suite.suites) {
55 printSuite(child, indent + 1);
56 }
57 };
58 const root = VerboseReporter.groupTestsBySuites(testResults);
59 printSuite(root, 0);
60};
61
62const getTestPaths = async (
63 globalConfig: Config.GlobalConfig,

Callers 2

runJestFunction · 0.85

Calls 2

printSuiteFunction · 0.85
groupTestsBySuitesMethod · 0.80

Tested by

no test coverage detected