Skip to content

Commit

Permalink
Delete preset from require cache to allow multiple projects
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-drexler committed May 16, 2018
1 parent 161dc5e commit fb62732
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/jest-config/src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ const setupPreset = (
try {
// $FlowFixMe
preset = (require(presetModule): InitialOptions);

// Force re-evaluation to support multiple projects
try {
if (presetModule) {
delete require.cache[require.resolve(presetModule)];
}
} catch (e) {}
} catch (error) {
if (error instanceof SyntaxError) {
throw createConfigError(
Expand Down

0 comments on commit fb62732

Please sign in to comment.