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

Function setupFiles

e2e/__tests__/watchModeOnlyFailed.test.ts:19–34  ·  view source on GitHub ↗
(input: Array<{keys: Array<string>}>)

Source from the content-addressed store, hash-verified

17afterAll(() => cleanup(DIR));
18
19const setupFiles = (input: Array<{keys: Array<string>}>) => {
20 writeFiles(DIR, {
21 '__tests__/bar.spec.js': `
22 test('bar 1', () => { expect('bar').toBe('foo'); });
23 `,
24 '__tests__/foo.spec.js': `
25 test('foo 1', () => { expect('foo').toBe('foo'); });
26 `,
27 'package.json': JSON.stringify({
28 jest: {
29 testEnvironment: 'node',
30 watchPlugins: [[pluginPath, {input}]],
31 },
32 }),
33 });
34};
35
36test('can press "f" to run only failed tests', () => {
37 const input = [{keys: ['f']}, {keys: ['q']}];

Callers 1

Calls 1

writeFilesFunction · 0.90

Tested by

no test coverage detected