From 831e3a969feb62bb95c0a215ca9ea251adb4f1cb Mon Sep 17 00:00:00 2001 From: Brandon Chinn Date: Sat, 2 Mar 2024 22:19:49 -0800 Subject: [PATCH] Break out TestPathPatternsExecutor --- e2e/runJest.ts | 2 +- packages/jest-config/src/normalize.ts | 12 +-- packages/jest-core/src/SearchSource.ts | 26 ++++-- .../__tests__/getNoTestsFoundMessage.test.ts | 2 +- .../jest-core/src/__tests__/runJest.test.js | 2 +- .../jest-core/src/__tests__/watch.test.js | 8 +- .../watchFilenamePatternMode.test.js | 2 +- .../watchTestNamePatternMode.test.js | 2 +- .../jest-core/src/lib/updateGlobalConfig.ts | 2 +- packages/jest-core/src/watch.ts | 6 +- .../src/__tests__/SummaryReporter.test.js | 2 +- packages/jest-types/src/Config.ts | 2 +- packages/jest-types/src/TestPathPatterns.ts | 70 +++++++++++---- .../src/__tests__/TestPathPatterns.test.ts | 90 ++++++++++++------- .../TestPathPatterns.test.ts.snap | 2 + packages/jest-types/src/index.ts | 6 +- packages/test-utils/src/config.ts | 2 +- 17 files changed, 157 insertions(+), 81 deletions(-) diff --git a/e2e/runJest.ts b/e2e/runJest.ts index ce968e959b9f..79100c7856a8 100644 --- a/e2e/runJest.ts +++ b/e2e/runJest.ts @@ -288,6 +288,6 @@ export function getConfig( return { ...globalConfig, - testPathPatterns: new TestPathPatterns(testPathPatterns, {rootDir: '/'}), + testPathPatterns: new TestPathPatterns(testPathPatterns), }; } diff --git a/packages/jest-config/src/normalize.ts b/packages/jest-config/src/normalize.ts index c44b101b56a8..db323455fdc8 100644 --- a/packages/jest-config/src/normalize.ts +++ b/packages/jest-config/src/normalize.ts @@ -392,10 +392,7 @@ const normalizeReporters = ({ }); }; -const buildTestPathPatterns = ( - argv: Config.Argv, - rootDir: string, -): TestPathPatterns => { +const buildTestPathPatterns = (argv: Config.Argv): TestPathPatterns => { const patterns = []; if (argv._) { @@ -405,8 +402,7 @@ const buildTestPathPatterns = ( patterns.push(...argv.testPathPatterns); } - const config = {rootDir}; - const testPathPatterns = new TestPathPatterns(patterns, config); + const testPathPatterns = new TestPathPatterns(patterns); if (!testPathPatterns.isValid()) { clearLine(process.stdout); @@ -419,7 +415,7 @@ const buildTestPathPatterns = ( ), ); - return new TestPathPatterns([], config); + return new TestPathPatterns([]); } return testPathPatterns; @@ -1009,7 +1005,7 @@ export default async function normalize( } newOptions.nonFlagArgs = argv._?.map(arg => `${arg}`); - const testPathPatterns = buildTestPathPatterns(argv, options.rootDir); + const testPathPatterns = buildTestPathPatterns(argv); newOptions.testPathPatterns = testPathPatterns; newOptions.json = !!argv.json; diff --git a/packages/jest-core/src/SearchSource.ts b/packages/jest-core/src/SearchSource.ts index be4044d4da2f..5d321ed5461b 100644 --- a/packages/jest-core/src/SearchSource.ts +++ b/packages/jest-core/src/SearchSource.ts @@ -9,7 +9,7 @@ import * as os from 'os'; import * as path from 'path'; import micromatch = require('micromatch'); import type {Test, TestContext} from '@jest/test-result'; -import type {Config, TestPathPatterns} from '@jest/types'; +import type {Config, TestPathPatternsExecutor} from '@jest/types'; import type {ChangedFiles} from 'jest-changed-files'; import {replaceRootDirInPath} from 'jest-config'; import {escapePathForRegex} from 'jest-regex-util'; @@ -114,7 +114,7 @@ export default class SearchSource { private _filterTestPathsWithStats( allPaths: Array, - testPathPatterns: TestPathPatterns, + testPathPatternsExecutor: TestPathPatternsExecutor, ): SearchResult { const data: { stats: Stats; @@ -132,9 +132,9 @@ export default class SearchSource { }; const testCases = [...this._testPathCases]; // clone - if (testPathPatterns.isSet()) { + if (testPathPatternsExecutor.isSet()) { testCases.push({ - isMatch: (path: string) => testPathPatterns.isMatch(path), + isMatch: (path: string) => testPathPatternsExecutor.isMatch(path), stat: 'testPathPatterns', }); data.stats.testPathPatterns = 0; @@ -155,10 +155,12 @@ export default class SearchSource { return data; } - private _getAllTestPaths(testPathPatterns: TestPathPatterns): SearchResult { + private _getAllTestPaths( + testPathPatternsExecutor: TestPathPatternsExecutor, + ): SearchResult { return this._filterTestPathsWithStats( toTests(this._context, this._context.hasteFS.getAllFiles()), - testPathPatterns, + testPathPatternsExecutor, ); } @@ -166,8 +168,10 @@ export default class SearchSource { return this._testPathCases.every(testCase => testCase.isMatch(path)); } - findMatchingTests(testPathPatterns: TestPathPatterns): SearchResult { - return this._getAllTestPaths(testPathPatterns); + findMatchingTests( + testPathPatternsExecutor: TestPathPatternsExecutor, + ): SearchResult { + return this._getAllTestPaths(testPathPatternsExecutor); } async findRelatedTests( @@ -291,7 +295,11 @@ export default class SearchSource { globalConfig.collectCoverage, ); } else { - return this.findMatchingTests(globalConfig.testPathPatterns); + return this.findMatchingTests( + globalConfig.testPathPatterns.toExecutor({ + rootDir: globalConfig.rootDir, + }), + ); } } diff --git a/packages/jest-core/src/__tests__/getNoTestsFoundMessage.test.ts b/packages/jest-core/src/__tests__/getNoTestsFoundMessage.test.ts index 03acaca976cd..4da3bc22c51c 100644 --- a/packages/jest-core/src/__tests__/getNoTestsFoundMessage.test.ts +++ b/packages/jest-core/src/__tests__/getNoTestsFoundMessage.test.ts @@ -18,7 +18,7 @@ describe('getNoTestsFoundMessage', () => { function createGlobalConfig(options?: Partial) { return makeGlobalConfig({ rootDir: '/root/dir', - testPathPatterns: new TestPathPatterns(['/path/pattern'], {rootDir: '/'}), + testPathPatterns: new TestPathPatterns(['/path/pattern']), ...options, }); } diff --git a/packages/jest-core/src/__tests__/runJest.test.js b/packages/jest-core/src/__tests__/runJest.test.js index a2e8368dd676..bc16f1e35221 100644 --- a/packages/jest-core/src/__tests__/runJest.test.js +++ b/packages/jest-core/src/__tests__/runJest.test.js @@ -24,7 +24,7 @@ describe('runJest', () => { contexts: [], globalConfig: { rootDir: '', - testPathPatterns: new TestPathPatterns([], {rootDir: '/'}), + testPathPatterns: new TestPathPatterns([]), testSequencer: require.resolve('@jest/test-sequencer'), watch: true, }, diff --git a/packages/jest-core/src/__tests__/watch.test.js b/packages/jest-core/src/__tests__/watch.test.js index 17a8c0b31cad..c19071fc63a5 100644 --- a/packages/jest-core/src/__tests__/watch.test.js +++ b/packages/jest-core/src/__tests__/watch.test.js @@ -143,7 +143,7 @@ describe('Watch mode flows', () => { pipe = {write: jest.fn()}; globalConfig = { rootDir: '', - testPathPatterns: new TestPathPatterns([], {rootDir: '/'}), + testPathPatterns: new TestPathPatterns([]), watch: true, }; hasteMapInstances = [{on: () => {}}]; @@ -157,9 +157,7 @@ describe('Watch mode flows', () => { }); it('Correctly passing test path pattern', async () => { - globalConfig.testPathPatterns = new TestPathPatterns(['test-*'], { - rootDir: '/', - }); + globalConfig.testPathPatterns = new TestPathPatterns(['test-*']); await watch(globalConfig, contexts, pipe, hasteMapInstances, stdin); @@ -695,7 +693,7 @@ describe('Watch mode flows', () => { const newVal = (() => { if (option === 'testPathPatterns') { - return new TestPathPatterns(['a/b', 'c'], {rootDir: '/'}); + return new TestPathPatterns(['a/b', 'c']); } return '__JUST_TRYING__'; diff --git a/packages/jest-core/src/__tests__/watchFilenamePatternMode.test.js b/packages/jest-core/src/__tests__/watchFilenamePatternMode.test.js index 1ae522a7157f..4b9cb0e53648 100644 --- a/packages/jest-core/src/__tests__/watchFilenamePatternMode.test.js +++ b/packages/jest-core/src/__tests__/watchFilenamePatternMode.test.js @@ -73,7 +73,7 @@ const nextTick = () => new Promise(resolve => process.nextTick(resolve)); const globalConfig = { rootDir: '', - testPathPatterns: new TestPathPatterns([], {rootDir: '/'}), + testPathPatterns: new TestPathPatterns([]), watch: true, }; diff --git a/packages/jest-core/src/__tests__/watchTestNamePatternMode.test.js b/packages/jest-core/src/__tests__/watchTestNamePatternMode.test.js index dff14f9ba495..9f7d573ff8e3 100644 --- a/packages/jest-core/src/__tests__/watchTestNamePatternMode.test.js +++ b/packages/jest-core/src/__tests__/watchTestNamePatternMode.test.js @@ -85,7 +85,7 @@ const watch = require('../watch').default; const globalConfig = { rootDir: '', - testPathPatterns: new TestPathPatterns([], {rootDir: '/'}), + testPathPatterns: new TestPathPatterns([]), watch: true, }; diff --git a/packages/jest-core/src/lib/updateGlobalConfig.ts b/packages/jest-core/src/lib/updateGlobalConfig.ts index ed9f349941d0..ff6227d61c20 100644 --- a/packages/jest-core/src/lib/updateGlobalConfig.ts +++ b/packages/jest-core/src/lib/updateGlobalConfig.ts @@ -31,7 +31,7 @@ export default function updateGlobalConfig( } if (options.testPathPatterns !== undefined) { - newConfig.testPathPatterns = new TestPathPatterns(options.testPathPatterns, {rootDir: globalConfig.rootDir}); + newConfig.testPathPatterns = new TestPathPatterns(options.testPathPatterns); } newConfig.onlyChanged = diff --git a/packages/jest-core/src/watch.ts b/packages/jest-core/src/watch.ts index 6805aebced09..d1099baaa533 100644 --- a/packages/jest-core/src/watch.ts +++ b/packages/jest-core/src/watch.ts @@ -229,11 +229,13 @@ export default async function watch( const emitFileChange = () => { if (hooks.isUsed('onFileChange')) { - const testPathPatterns = new TestPathPatterns([], globalConfig); + const testPathPatternsExecutor = new TestPathPatterns([]).toExecutor({ + rootDir: globalConfig.rootDir, + }); const projects = searchSources.map(({context, searchSource}) => ({ config: context.config, testPaths: searchSource - .findMatchingTests(testPathPatterns) + .findMatchingTests(testPathPatternsExecutor) .tests.map(t => t.path), })); hooks.getEmitter().onFileChange({projects}); diff --git a/packages/jest-reporters/src/__tests__/SummaryReporter.test.js b/packages/jest-reporters/src/__tests__/SummaryReporter.test.js index a5435a9d55bc..66ba0e00d3cf 100644 --- a/packages/jest-reporters/src/__tests__/SummaryReporter.test.js +++ b/packages/jest-reporters/src/__tests__/SummaryReporter.test.js @@ -15,7 +15,7 @@ const now = Date.now; const write = process.stderr.write; const globalConfig = { rootDir: 'root', - testPathPatterns: new TestPathPatterns([], {rootDir: '/'}), + testPathPatterns: new TestPathPatterns([]), watch: false, }; diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index bb5d5282ced6..46e6412b3efe 100644 --- a/packages/jest-types/src/Config.ts +++ b/packages/jest-types/src/Config.ts @@ -9,7 +9,7 @@ import type {ForegroundColor} from 'chalk'; import type {ReportOptions} from 'istanbul-reports'; import type {Arguments} from 'yargs'; import type {InitialOptions, SnapshotFormat} from '@jest/schemas'; -import type TestPathPatterns from './TestPathPatterns'; +import type {TestPathPatterns} from './TestPathPatterns'; export type {InitialOptions} from '@jest/schemas'; diff --git a/packages/jest-types/src/TestPathPatterns.ts b/packages/jest-types/src/TestPathPatterns.ts index b90005b6324b..26b0f4132117 100644 --- a/packages/jest-types/src/TestPathPatterns.ts +++ b/packages/jest-types/src/TestPathPatterns.ts @@ -7,16 +7,62 @@ import {escapePathForRegex, replacePathSepForRegex} from 'jest-regex-util'; -type PatternsConfig = { +export class TestPathPatterns { + constructor(readonly patterns: Array) {} + + /** + * Return true if there are any patterns. + */ + isSet(): boolean { + return this.patterns.length > 0; + } + + /** + * Return true if the patterns are valid. + */ + isValid(): boolean { + return this.toExecutor({ + // isValid() doesn't require rootDir to be accurate, so just + // specify a dummy rootDir here + rootDir: '/', + }).isValid(); + } + + /** + * Return a human-friendly version of the pattern regex. + */ + toPretty(): string { + return this.patterns.join('|'); + } + + /** + * Return a TestPathPatternsExecutor that can execute the patterns. + */ + toExecutor( + options: TestPathPatternsExecutorOptions, + ): TestPathPatternsExecutor { + return new TestPathPatternsExecutor(this, options); + } + + /** For jest serializers */ + toJSON(): any { + return { + patterns: this.patterns, + type: 'TestPathPatterns', + }; + } +} + +export type TestPathPatternsExecutorOptions = { rootDir: string; }; -export default class TestPathPatterns { +export class TestPathPatternsExecutor { private _regexString: string | null = null; constructor( - readonly patterns: Array, - private readonly config: PatternsConfig, + readonly patterns: TestPathPatterns, + private readonly options: TestPathPatternsExecutorOptions, ) {} private get regexString(): string { @@ -24,10 +70,10 @@ export default class TestPathPatterns { return this._regexString; } - const rootDir = this.config.rootDir.replace(/\/*$/, '/'); + const rootDir = this.options.rootDir.replace(/\/*$/, '/'); const rootDirRegex = escapePathForRegex(rootDir); - const regexString = this.patterns + const regexString = this.patterns.patterns .map(p => { // absolute paths passed on command line should stay same if (p.startsWith('/')) { @@ -57,7 +103,7 @@ export default class TestPathPatterns { * Return true if there are any patterns. */ isSet(): boolean { - return this.patterns.length > 0; + return this.patterns.isSet(); } /** @@ -85,14 +131,6 @@ export default class TestPathPatterns { * Return a human-friendly version of the pattern regex. */ toPretty(): string { - return this.patterns.join('|'); - } - - /** For jest serializers */ - toJSON(): any { - return { - patterns: this.patterns, - type: 'TestPathPatterns', - }; + return this.patterns.toPretty(); } } diff --git a/packages/jest-types/src/__tests__/TestPathPatterns.test.ts b/packages/jest-types/src/__tests__/TestPathPatterns.test.ts index 2d1a77e4805a..ced625fb17ed 100644 --- a/packages/jest-types/src/__tests__/TestPathPatterns.test.ts +++ b/packages/jest-types/src/__tests__/TestPathPatterns.test.ts @@ -6,7 +6,11 @@ */ import type * as path from 'path'; -import TestPathPatterns from '../TestPathPatterns'; +import { + TestPathPatterns, + TestPathPatternsExecutor, + type TestPathPatternsExecutorOptions, +} from '../TestPathPatterns'; const mockSep: jest.Mock<() => string> = jest.fn(); jest.mock('path', () => { @@ -23,86 +27,117 @@ beforeEach(() => { const config = {rootDir: ''}; -describe('TestPathPatterns', () => { +interface TestPathPatternsLike { + isSet(): boolean; + isValid(): boolean; + toPretty(): string; +} + +const testPathPatternsLikeTests = ( + makePatterns: ( + patterns: Array, + options: TestPathPatternsExecutorOptions, + ) => TestPathPatternsLike, +) => { describe('isSet', () => { it('returns false if no patterns specified', () => { - const testPathPatterns = new TestPathPatterns([], config); + const testPathPatterns = makePatterns([], config); expect(testPathPatterns.isSet()).toBe(false); }); it('returns true if patterns specified', () => { - const testPathPatterns = new TestPathPatterns(['a'], config); + const testPathPatterns = makePatterns(['a'], config); expect(testPathPatterns.isSet()).toBe(true); }); }); describe('isValid', () => { it('succeeds for empty patterns', () => { - const testPathPatterns = new TestPathPatterns([], config); + const testPathPatterns = makePatterns([], config); expect(testPathPatterns.isValid()).toBe(true); }); it('succeeds for valid patterns', () => { - const testPathPatterns = new TestPathPatterns(['abc+', 'z.*'], config); + const testPathPatterns = makePatterns(['abc+', 'z.*'], config); expect(testPathPatterns.isValid()).toBe(true); }); it('fails for at least one invalid pattern', () => { - const testPathPatterns = new TestPathPatterns( - ['abc+', '(', 'z.*'], - config, - ); + const testPathPatterns = makePatterns(['abc+', '(', 'z.*'], config); expect(testPathPatterns.isValid()).toBe(false); }); }); + describe('toPretty', () => { + it('renders a human-readable string', () => { + const testPathPatterns = makePatterns(['a/b', 'c/d'], config); + expect(testPathPatterns.toPretty()).toMatchSnapshot(); + }); + }); +}; + +describe('TestPathPatterns', () => { + testPathPatternsLikeTests( + (patterns: Array, _: TestPathPatternsExecutorOptions) => + new TestPathPatterns(patterns), + ); +}); + +describe('TestPathPatternsExecutor', () => { + const makeExecutor = ( + patterns: Array, + options: TestPathPatternsExecutorOptions, + ) => new TestPathPatternsExecutor(new TestPathPatterns(patterns), options); + + testPathPatternsLikeTests(makeExecutor); + describe('isMatch', () => { it('returns true with no patterns', () => { - const testPathPatterns = new TestPathPatterns([], config); + const testPathPatterns = makeExecutor([], config); expect(testPathPatterns.isMatch('/a/b')).toBe(true); }); it('returns true for same path', () => { - const testPathPatterns = new TestPathPatterns(['/a/b'], config); + const testPathPatterns = makeExecutor(['/a/b'], config); expect(testPathPatterns.isMatch('/a/b')).toBe(true); }); it('returns true for same path with case insensitive', () => { - const testPathPatternsUpper = new TestPathPatterns(['/A/B'], config); + const testPathPatternsUpper = makeExecutor(['/A/B'], config); expect(testPathPatternsUpper.isMatch('/a/b')).toBe(true); expect(testPathPatternsUpper.isMatch('/A/B')).toBe(true); - const testPathPatternsLower = new TestPathPatterns(['/a/b'], config); + const testPathPatternsLower = makeExecutor(['/a/b'], config); expect(testPathPatternsLower.isMatch('/A/B')).toBe(true); expect(testPathPatternsLower.isMatch('/a/b')).toBe(true); }); it('returns true for contained path', () => { - const testPathPatterns = new TestPathPatterns(['b/c'], config); + const testPathPatterns = makeExecutor(['b/c'], config); expect(testPathPatterns.isMatch('/a/b/c/d')).toBe(true); }); it('returns true for explicit relative path', () => { - const testPathPatterns = new TestPathPatterns(['./b/c'], { + const testPathPatterns = makeExecutor(['./b/c'], { rootDir: '/a', }); expect(testPathPatterns.isMatch('/a/b/c')).toBe(true); }); it('returns true for partial file match', () => { - const testPathPatterns = new TestPathPatterns(['aaa'], config); + const testPathPatterns = makeExecutor(['aaa'], config); expect(testPathPatterns.isMatch('/foo/..aaa..')).toBe(true); expect(testPathPatterns.isMatch('/foo/..aaa')).toBe(true); expect(testPathPatterns.isMatch('/foo/aaa..')).toBe(true); }); it('returns true for path suffix', () => { - const testPathPatterns = new TestPathPatterns(['c/d'], config); + const testPathPatterns = makeExecutor(['c/d'], config); expect(testPathPatterns.isMatch('/a/b/c/d')).toBe(true); }); it('returns true if regex matches', () => { - const testPathPatterns = new TestPathPatterns(['ab*c?'], config); + const testPathPatterns = makeExecutor(['ab*c?'], config); expect(testPathPatterns.isMatch('/foo/a')).toBe(true); expect(testPathPatterns.isMatch('/foo/ab')).toBe(true); @@ -115,7 +150,7 @@ describe('TestPathPatterns', () => { }); it('returns true only if matches relative path', () => { - const testPathPatterns = new TestPathPatterns(['home'], { + const testPathPatterns = makeExecutor(['home'], { rootDir: '/home/myuser/', }); expect(testPathPatterns.isMatch('/home/myuser/LoginPage.js')).toBe(false); @@ -123,14 +158,14 @@ describe('TestPathPatterns', () => { }); it('matches absolute paths regardless of rootDir', () => { - const testPathPatterns = new TestPathPatterns(['/a/b'], { + const testPathPatterns = makeExecutor(['/a/b'], { rootDir: '/foo/bar', }); expect(testPathPatterns.isMatch('/a/b')).toBe(true); }); it('returns true if match any paths', () => { - const testPathPatterns = new TestPathPatterns(['a/b', 'c/d'], config); + const testPathPatterns = makeExecutor(['a/b', 'c/d'], config); expect(testPathPatterns.isMatch('/foo/a/b')).toBe(true); expect(testPathPatterns.isMatch('/foo/c/d')).toBe(true); @@ -141,21 +176,14 @@ describe('TestPathPatterns', () => { it('does not normalize Windows paths on POSIX', () => { mockSep.mockReturnValue('/'); - const testPathPatterns = new TestPathPatterns(['a\\z', 'a\\\\z'], config); + const testPathPatterns = makeExecutor(['a\\z', 'a\\\\z'], config); expect(testPathPatterns.isMatch('/foo/a/z')).toBe(false); }); it('normalizes paths for Windows', () => { mockSep.mockReturnValue('\\'); - const testPathPatterns = new TestPathPatterns(['a/b'], config); + const testPathPatterns = makeExecutor(['a/b'], config); expect(testPathPatterns.isMatch('\\foo\\a\\b')).toBe(true); }); }); - - describe('toPretty', () => { - it('renders a human-readable string', () => { - const testPathPatterns = new TestPathPatterns(['a/b', 'c/d'], config); - expect(testPathPatterns.toPretty()).toMatchSnapshot(); - }); - }); }); diff --git a/packages/jest-types/src/__tests__/__snapshots__/TestPathPatterns.test.ts.snap b/packages/jest-types/src/__tests__/__snapshots__/TestPathPatterns.test.ts.snap index 5b97f3ca2f59..14a6ec2592d0 100644 --- a/packages/jest-types/src/__tests__/__snapshots__/TestPathPatterns.test.ts.snap +++ b/packages/jest-types/src/__tests__/__snapshots__/TestPathPatterns.test.ts.snap @@ -1,3 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`TestPathPatterns toPretty renders a human-readable string 1`] = `"a/b|c/d"`; + +exports[`TestPathPatternsExecutor toPretty renders a human-readable string 1`] = `"a/b|c/d"`; diff --git a/packages/jest-types/src/index.ts b/packages/jest-types/src/index.ts index 6b5c8fdd4006..d5698530cba2 100644 --- a/packages/jest-types/src/index.ts +++ b/packages/jest-types/src/index.ts @@ -12,4 +12,8 @@ import type * as TestResult from './TestResult'; import type * as TransformTypes from './Transform'; export type {Circus, Config, Global, TestResult, TransformTypes}; -export {default as TestPathPatterns} from './TestPathPatterns'; +export { + TestPathPatterns, + TestPathPatternsExecutor, + type TestPathPatternsExecutorOptions, +} from './TestPathPatterns'; diff --git a/packages/test-utils/src/config.ts b/packages/test-utils/src/config.ts index d04069972ce0..92d83c47c9be 100644 --- a/packages/test-utils/src/config.ts +++ b/packages/test-utils/src/config.ts @@ -55,7 +55,7 @@ const DEFAULT_GLOBAL_CONFIG: Config.GlobalConfig = { snapshotFormat: {}, testFailureExitCode: 1, testNamePattern: '', - testPathPatterns: new TestPathPatterns([], {rootDir: '/'}), + testPathPatterns: new TestPathPatterns([]), testResultsProcessor: undefined, testSequencer: '@jest/test-sequencer', testTimeout: 5000,