Skip to content

Commit

Permalink
[jest-resolve] cache current directory path (#8412)
Browse files Browse the repository at this point in the history
  • Loading branch information
Connormiha authored and SimenB committed May 3, 2019
1 parent b870306 commit 46afa44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -40,6 +40,7 @@

- `[jest-runtime]` Fix module registry memory leak ([#8282](https://github.com/facebook/jest/pull/8282))
- `[jest-resolve]` optimize resolve module path ([#8388](https://github.com/facebook/jest/pull/8388))
- `[jest-resolve]` cache current directory ([#8412](https://github.com/facebook/jest/pull/8412))

## 24.7.1

Expand Down
3 changes: 2 additions & 1 deletion packages/jest-resolve/src/defaultResolver.ts
Expand Up @@ -188,6 +188,7 @@ function isDirectory(dir: Config.Path): boolean {
return statSyncCached(dir) === IPathType.DIRECTORY;
}

const CURRENT_DIRECTORY = path.resolve('.');
function isCurrentDirectory(testPath: Config.Path): boolean {
return path.resolve('.') === path.resolve(testPath);
return CURRENT_DIRECTORY === path.resolve(testPath);
}

0 comments on commit 46afa44

Please sign in to comment.