Skip to content

Commit

Permalink
feat(jest-haste-map): Enable crawling for symlink test files
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmeku committed Dec 30, 2019
1 parent 9419034 commit 4497c98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,7 @@

### Features

- `[jest-haste-map]` Enable crawling for symlink test files ([#9350](https://github.com/facebook/jest/issues/9350))
- `[babel-plugin-jest-hoist]` Show codeframe on static hoisting issues ([#8865](https://github.com/facebook/jest/pull/8865))
- `[babel-plugin-jest-hoist]` Add `BigInt` to `WHITELISTED_IDENTIFIERS` ([#8382](https://github.com/facebook/jest/pull/8382))
- `[babel-preset-jest]` Add `@babel/plugin-syntax-bigint` ([#8382](https://github.com/facebook/jest/pull/8382))
Expand Down
6 changes: 4 additions & 2 deletions packages/jest-haste-map/src/crawlers/node.ts
Expand Up @@ -84,7 +84,8 @@ function findNative(
callback: Callback,
): void {
const args = Array.from(roots);
args.push('-type', 'f');
args.push('(', '-type', 'f', '-o', '-type', 'l', ')');

if (extensions.length) {
args.push('(');
}
Expand Down Expand Up @@ -121,7 +122,8 @@ function findNative(
} else {
lines.forEach(path => {
fs.stat(path, (err, stat) => {
if (!err && stat) {
// Filter out symlinks that describe directories
if (!err && stat && stat.isFile && stat.isFile()) {
result.push([path, stat.mtime.getTime(), stat.size]);
}
if (--count === 0) {
Expand Down

0 comments on commit 4497c98

Please sign in to comment.