Skip to content

Commit b335bee

Browse files
authored
fix: Override paths in memory also in "test" mode (#571)
1 parent 1c78b9d commit b335bee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ const pathsConfig = require(pathsConfigPath);
1212
// extend paths with overrides
1313
paths = Object.assign({}, paths, overrides.paths(pathsConfig, process.env.NODE_ENV));
1414

15+
// override paths in memory
16+
require.cache[require.resolve(pathsConfigPath)].exports =
17+
paths;
18+
1519
// hide overrides in package.json for CRA's original createJestConfig
1620
const packageJson = require(paths.appPackageJson);
1721
const jestOverrides = packageJson.jest;

0 commit comments

Comments
 (0)