Skip to content

Commit 5326955

Browse files
committed
fix(config/jest): set Jest root to '.' in config, but use '<rootDir>/src' for project
Change Jest root directory to ./ instead of './src' and './test' because specifying a root that doesn't exist throws an error. Use '<rootDir>/src' for this project to avoid weird mock errors from `jest-haste-map` on CI... may need to revisit this.
1 parent 7c7edaf commit 5326955

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const {jest: jestConfig} = require('./src/config')
22

33
module.exports = Object.assign(jestConfig, {
4+
roots: ['<rootDir>/src'],
45
coverageThreshold: null,
56
})

src/config/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const testMatchSuffixGlob = toGlob(
2020
)
2121

2222
const jestConfig = {
23-
roots: [fromRoot('src'), fromRoot('test')],
23+
roots: [fromRoot('.')],
2424
testEnvironment: ifAnyDep(['webpack', 'rollup', 'react'], 'jsdom', 'node'),
2525
testURL: 'http://localhost',
2626
moduleFileExtensions: testMatchExtensions.concat('json'),

0 commit comments

Comments
 (0)