Skip to content

Commit 4aa8be9

Browse files
committed
Only run tests directly in __tests__
This lets us share code between test files by placing them in __tests__/utils.
1 parent 17c06b4 commit 4aa8be9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/jest/config.source.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ module.exports = {
1010
},
1111
setupFiles: [require.resolve('./setupEnvironment.js')],
1212
setupTestFrameworkScriptFile: require.resolve('./setupTests.js'),
13-
testRegex: '/__tests__/.*(\\.js|\\.coffee|[^d]\\.ts)$',
13+
// Only include files directly in __tests__, not in nested folders.
14+
testRegex: '/__tests__/[^/]*(\\.js|\\.coffee|[^d]\\.ts)$',
1415
moduleFileExtensions: ['js', 'json', 'node', 'coffee', 'ts'],
1516
rootDir: process.cwd(),
1617
roots: ['<rootDir>/packages', '<rootDir>/scripts'],

0 commit comments

Comments
 (0)