Skip to content

Commit 518c357

Browse files
Update testPathPatterns in updateGlobalConfig
1 parent 993fc50 commit 518c357

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/jest-core/src/lib/updateGlobalConfig.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import type {Config} from '@jest/types';
9-
import {replacePathSepForRegex} from 'jest-regex-util';
9+
import {TestPathPatterns} from 'jest-util';
1010
import type {AllowedConfigOptions} from 'jest-watcher';
1111

1212
type ExtraConfigOptions = Partial<
@@ -31,15 +31,14 @@ export default function updateGlobalConfig(
3131
newConfig.testNamePattern = options.testNamePattern || '';
3232
}
3333

34-
if (options.testPathPattern !== undefined) {
35-
newConfig.testPathPattern =
36-
replacePathSepForRegex(options.testPathPattern) || '';
34+
if (options.testPathPatterns !== undefined) {
35+
newConfig.testPathPatterns = options.testPathPatterns;
3736
}
3837

3938
newConfig.onlyChanged =
4039
!newConfig.watchAll &&
4140
!newConfig.testNamePattern &&
42-
!newConfig.testPathPattern;
41+
!new TestPathPatterns(newConfig).isSet();
4342

4443
if (typeof options.bail === 'boolean') {
4544
newConfig.bail = options.bail ? 1 : 0;

0 commit comments

Comments
 (0)