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

Function testIn2Workers

e2e/__tests__/nonSerializableStructuresInequality.test.ts:20–41  ·  view source on GitHub ↗
(
  testFileContent: string,
  extraOptions: Array<string> = [],
)

Source from the content-addressed store, hash-verified

18const tempDir = path.resolve(tmpdir(), 'bigint-inequality-test');
19
20const testIn2Workers = async (
21 testFileContent: string,
22 extraOptions: Array<string> = [],
23) => {
24 writeFiles(tempDir, {
25 '__tests__/test-1.js': testFileContent,
26 '__tests__/test-2.js': testFileContent,
27 });
28
29 const {end, waitUntil} = runContinuous(
30 tempDir,
31 ['--no-watchman', '--watch-all', ...extraOptions],
32 // timeout in case the `waitUntil` below doesn't fire
33 {stripAnsi: true, timeout: 5000},
34 );
35
36 await waitUntil(({stderr}) => stderr.includes('Ran all test suites.'));
37
38 const {stderr} = await end();
39
40 return extractSortedSummary(stderr);
41};
42
43beforeEach(() => {
44 createEmptyPackage(tempDir);

Calls 5

writeFilesFunction · 0.90
runContinuousFunction · 0.90
extractSortedSummaryFunction · 0.90
waitUntilFunction · 0.85
endFunction · 0.50

Tested by

no test coverage detected