Skip to content

Commit e2a1459

Browse files
committed
Apply changes from jestjs#11817 to async method
1 parent 0c0e6df commit e2a1459

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: packages/jest-resolve/src/resolver.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,12 @@ export default class Resolver {
709709
const resolveNodeModule = async (
710710
name: Config.Path,
711711
throwIfNotFound = false,
712-
) =>
713-
await Resolver.findNodeModuleAsync(name, {
712+
) => {
713+
if (this.isCoreModule(name)) {
714+
return name;
715+
}
716+
717+
return await Resolver.findNodeModuleAsync(name, {
714718
basedir: dirname,
715719
extensions,
716720
moduleDirectory,
@@ -719,6 +723,7 @@ export default class Resolver {
719723
rootDir: this._options.rootDir,
720724
throwIfNotFound,
721725
});
726+
};
722727

723728
if (!skipResolution) {
724729
module = await resolveNodeModule(

0 commit comments

Comments
 (0)