Skip to content

Commit

Permalink
Delete require cache before requiring preset
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-drexler committed May 18, 2018
1 parent c24ac99 commit 7296a55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/jest-config/src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ 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) {}

// $FlowFixMe
preset = (require(presetModule): InitialOptions);
} catch (error) {
if (error instanceof SyntaxError) {
throw createConfigError(
Expand Down

0 comments on commit 7296a55

Please sign in to comment.