Skip to content

Commit

Permalink
fix: Override paths in memory also in "test" mode (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
bencergazda committed Dec 30, 2021
1 parent 1c78b9d commit b335bee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ const pathsConfig = require(pathsConfigPath);
// extend paths with overrides
paths = Object.assign({}, paths, overrides.paths(pathsConfig, process.env.NODE_ENV));

// override paths in memory
require.cache[require.resolve(pathsConfigPath)].exports =
paths;

// hide overrides in package.json for CRA's original createJestConfig
const packageJson = require(paths.appPackageJson);
const jestOverrides = packageJson.jest;
Expand Down

0 comments on commit b335bee

Please sign in to comment.