Skip to content

Commit

Permalink
fix(testing): use rootDir to resolve files with ts
Browse files Browse the repository at this point in the history
  • Loading branch information
barbados-clemens committed Mar 15, 2023
1 parent 72d64b6 commit 5580440
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/jest/plugins/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ module.exports = function (path: string, options: ResolveOptions) {
ts = ts || require('typescript');
compilerSetup = compilerSetup || getCompilerSetup(options.rootDir);
const { compilerOptions, host } = compilerSetup;
return ts.resolveModuleName(path, options.basedir, compilerOptions, host)
.resolvedModule.resolvedFileName;
return ts.resolveModuleName(
path,
options.rootDir || options.basedir,
compilerOptions,
host
).resolvedModule.resolvedFileName;
}
};

0 comments on commit 5580440

Please sign in to comment.