diff --git a/packages/jest-runner/src/runTest.js b/packages/jest-runner/src/runTest.js index 8908a54b58ec..a14bb51dc3ae 100644 --- a/packages/jest-runner/src/runTest.js +++ b/packages/jest-runner/src/runTest.js @@ -70,9 +70,10 @@ async function runTestInternal( ? require('jest-circus/runner') // eslint-disable-line import/no-extraneous-dependencies : /* $FlowFixMe */ require(config.testRunner)): TestFramework); - /* $FlowFixMe */ - const Runtime = (require(config.moduleLoader || - 'jest-runtime'): Class); + const Runtime = ((config.moduleLoader + ? /* $FlowFixMe */ + require(config.moduleLoader) + : require('jest-runtime')): Class); let runtime = undefined; diff --git a/packages/jest-runtime/src/index.js b/packages/jest-runtime/src/index.js index f91e481a2925..25454aef7058 100644 --- a/packages/jest-runtime/src/index.js +++ b/packages/jest-runtime/src/index.js @@ -966,4 +966,7 @@ class Runtime { } Runtime.ScriptTransformer = ScriptTransformer; + module.exports = Runtime; + +export default Runtime;