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 13, 2021
1 parent 2f22e63 commit b032ef5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/jest-resolve/src/resolver.ts
Expand Up @@ -733,8 +733,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,
conditions: options?.conditions,
extensions,
Expand All @@ -744,6 +748,7 @@ export default class Resolver {
rootDir: this._options.rootDir,
throwIfNotFound,
});
};

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

0 comments on commit b032ef5

Please sign in to comment.