Skip to content

Commit

Permalink
lift out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Apr 28, 2020
1 parent 4a15a26 commit 1962370
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/jest-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,10 @@ class Runtime {
}

if (config.automock) {
const virtualMocks = fromEntries(this._virtualMocks);
config.setupFiles.forEach(filePath => {
if (filePath && filePath.includes(NODE_MODULES)) {
const moduleID = this._resolver.getModuleID(
fromEntries(this._virtualMocks),
filePath,
);
const moduleID = this._resolver.getModuleID(virtualMocks, filePath);
this._transitiveShouldMock.set(moduleID, false);
}
});
Expand Down

0 comments on commit 1962370

Please sign in to comment.