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

Function testFn

e2e/circus-concurrent/__tests__/concurrent-mixed.test.js:25–36  ·  view source on GitHub ↗
(name, delay, fail)

Source from the content-addressed store, hash-verified

23afterEach(() => marker('afterEach'));
24
25const testFn = (name, delay, fail) => {
26 return async () => {
27 marker(`START "${name}"`);
28 await setTimeout(delay);
29 if (fail) {
30 throw new Error(`${name} failed`);
31 }
32 expect(name).toBe(name);
33 expect.assertions(1);
34 marker(`END: "${name}"`);
35 };
36};
37
38it.concurrent('one', testFn('one', 85));
39it('two (sequential)', testFn('two (sequential)', 100));

Callers 1

Calls 4

expectFunction · 0.85
toBeMethod · 0.80
assertionsMethod · 0.80
markerFunction · 0.70

Tested by

no test coverage detected