Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Sep 19, 2023
1 parent 1b406fd commit 9e94c5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/jest-resolve/src/fileWalkers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ function statSyncCached(path: string): IPathType {
return result;
}

const stat = fs.statSync(path, {throwIfNoEntry: false});
let stat;
try {
stat = fs.statSync(path, {throwIfNoEntry: false});
} catch (e: any) {
if (!(e && (e.code === 'ENOENT' || e.code === 'ENOTDIR'))) {
throw e;
}
}

if (stat) {
if (stat.isFile() || stat.isFIFO()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('Runtime requireModule', () => {
'exports',
'filename',
'id',
'isPreloading',
'loaded',
'path',
'parent',
Expand All @@ -60,6 +61,7 @@ describe('Runtime requireModule', () => {
'exports',
'filename',
'id',
'isPreloading',
'loaded',
'path',
'parent',
Expand Down

0 comments on commit 9e94c5e

Please sign in to comment.