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

Function runJest

e2e/runJest.ts:42–58  ·  e2e/runJest.ts::runJest
(
  dir: string,
  args?: Array<string>,
  options: RunJestOptions = {},
)

Source from the content-addressed store, hash-verified

40class="cm">// [ class="st">'status', class="st">'signal', class="st">'output', class="st">'pid', class="st">'stdout', class="st">'stderr',
41class="cm">// class="st">'envPairs', class="st">'options', class="st">'args', class="st">'file' ]
42export default function runJest(
43 dir: string,
44 args?: Array<string>,
45 options: RunJestOptions = {},
46): RunJestResult {
47 const result = spawnJest(dir, args, options);
48
49 if (result.killed) {
50 throw new Error(dedent`
51 Spawned process was killed.
52 DETAILS:
53 ${JSON.stringify(result, null, 2)}
54 `);
55 }
56
57 return normalizeStdoutAndStderrOnResult(result, options);
58}
59
60function spawnJest(
61 dir: string,

Calls 2

spawnJestFunction · 0.85

Tested by 2

runJestTwiceFunction · 0.40