Skip to content

Commit

Permalink
fix: use require for async loading in jest environment
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Jan 18, 2024
1 parent e44377c commit 878ab64
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/loader/built-in/module/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import {
handleException,
hasStringProperty,
isFilePath,
isFilePath, isJestRuntimeEnvironment,
isObject,
isTsNodeRuntimeEnvironment,
isTypeScriptError,
Expand Down Expand Up @@ -94,11 +94,10 @@ export class ModuleLoader implements Loader {
try {
// segmentation fault
// issue: https://github.com/nodejs/node/issues/35889
/*
if (isJestRuntimeEnvironment()) {
// eslint-disable-next-line global-require,import/no-dynamic-require
return require(id);
}
*/

return await import(id);
} catch (e) {
Expand Down

0 comments on commit 878ab64

Please sign in to comment.