Skip to content

Commit 2c2d59b

Browse files
authored
Additional fix for #4444 to prevent errors on windows
1 parent 2047a36 commit 2c2d59b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/jest-transform/src/ScriptTransformer.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,12 @@ const readCacheFile = (cachePath: Config.Path): string | null => {
933933
try {
934934
fileData = fs.readFileSync(cachePath, 'utf8');
935935
} catch (e) {
936+
// on windows write-file-atomic is not atomic which can
937+
// result in this error
938+
if (e.code === 'ENOENT' && process.platform === 'win32') {
939+
return null;
940+
}
941+
936942
e.message =
937943
'jest: failed to read cache file: ' +
938944
cachePath +

0 commit comments

Comments
 (0)