Skip to content

Commit

Permalink
Apply changes from jestjs#11817 to async method
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed Sep 10, 2021
1 parent 0c0e6df commit e2a1459
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/jest-resolve/src/resolver.ts
Expand Up @@ -709,8 +709,12 @@ export default class Resolver {
const resolveNodeModule = async (
name: Config.Path,
throwIfNotFound = false,
) =>
await Resolver.findNodeModuleAsync(name, {
) => {
if (this.isCoreModule(name)) {
return name;
}

return await Resolver.findNodeModuleAsync(name, {
basedir: dirname,
extensions,
moduleDirectory,
Expand All @@ -719,6 +723,7 @@ export default class Resolver {
rootDir: this._options.rootDir,
throwIfNotFound,
});
};

if (!skipResolution) {
module = await resolveNodeModule(
Expand Down

0 comments on commit e2a1459

Please sign in to comment.