From 7296a552b03a5e413569396f1f4728de36c4a272 Mon Sep 17 00:00:00 2001 From: Robin Drexler Date: Fri, 18 May 2018 21:13:17 +0200 Subject: [PATCH] Delete require cache before requiring preset --- packages/jest-config/src/normalize.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jest-config/src/normalize.js b/packages/jest-config/src/normalize.js index 1d579761488b..408f7aeda3f0 100644 --- a/packages/jest-config/src/normalize.js +++ b/packages/jest-config/src/normalize.js @@ -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(