Skip to content
/ jest Public
forked from jestjs/jest

Commit

Permalink
try more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 8, 2021
1 parent 3cd0076 commit 27d16e1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/jest-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,22 @@ export default class Runtime {
return this._getMockedNativeModule();
}

return require(moduleWithoutNodePrefix);
try {
return require(moduleWithoutNodePrefix);
} catch (e) {
console.error(
'Error requiring core module',
{
moduleName,
moduleWithoutNodePrefix,
supportPrefix,
supportsNodeColonModulePrefixInImport,
supportsNodeColonModulePrefixInRequire,
},
e,
);
throw e;
}
}

private _importCoreModule(moduleName: string, context: VMContext) {
Expand Down

0 comments on commit 27d16e1

Please sign in to comment.