jest: jest-resolve fails on network drives and RAM-drives on Windows
π₯ Regression Report
Starting with jest@23 our tests started failing when using a RAM-drive on Windows (we are using a tool called ImDisk). The same can be reproduced when using a network drive (net use
).
Last working version
Worked up to version: v22.4.4
Stopped working in version: v23.0.0
To Reproduce
Steps to reproduce the behavior:
- Follow the Getting Started guide and create a simple test suite
- Create a network drive e.g.
net use x: \\localhost\c$\tmp
- Open the command line in
x:
and runyarn test
/npm test
Expected behavior
Test suite should pass.
Actual behavior
Resolution fails with different kinds of errors, e.g.:
Cannot find module 'source-map-support' from 'source-map-support.js'
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)
or
EISDIR: illegal operation on a directory, realpath '...\node_modules\regenerator-runtime'
at realpathSync (node_modules/realpath-native/index.js:25:32)
Run npx envinfo --preset jest
Paste the results here:
System:
OS: Windows 8.1
CPU: x64 Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz
Binaries:
Yarn: 1.7.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (12 by maintainers)
Commits related to this issue
- jest-resolve - only resolve realpath once in try-catch (#6925) Fixes #6880 — committed to jestjs/jest by asapach 6 years ago
I was getting
Changing
to
fixed the issue
Yes, sorry, I meant
jest-resolve
options. Weβre already using a custom resolver in our project, so that should work fine.