-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jest-resolve fails on network drives and RAM-drives on Windows #6880
Comments
The issue was introduced in #5085. If I roll it back it works fine. Is it possible to hide the symlinks resolution logic behind an option e.g. (CC @nickpape-msft) |
None on the team uses Windows, so I'm afraid this won't be fixed without help from the community. I'm also unsure what the correct solution would be, if to fix your issue we have to rollback a fix to another one... |
I'm not proposing to roll it back, I'd prefer to have an option that would allow to switch between the two modes. I can create a PR if that's OK. |
Having an option for this in jest's config should be the last resort, I think. I suppose we could add it as an option to |
Yes, sorry, I meant |
PR for that would be most welcome :) |
@SimenB I'm almost there (I've got a fork ready: https://github.com/asapach/jest/tree/symlinks), but I got stuck. I can create a custom resolver and pass my options, but there's a root resolver created in It does not delegate to custom resolver and fails here: Do you have any suggestions how to work around that? Any help is appreciated. |
Auch... @thymikee thoughts? I'm not familiar with this part of the code base |
I guess we'll need to add a new project option |
I took a look and I think it's not feasible to pass the option correctly to every resolve call. This would affect I have an alternative proposal: we could call |
How would that affect resolve performance? |
"Happy path" should not be different - one |
We don't have a special suite for that. Usually checking on Jest, React, maybe Webpack codebase. Also @mjesun and @aaronabramov make sure everything runs smoothly on FB, so you can ask them to test your diff |
OK, thanks. I'll get the PR ready tomorrow. |
I'm interested to test this as well, though I may not get a chance for a few days. #5085 had a measurable negative impact on performance so I'd be concerned about adding even more overhead. However, I'd also be pleased if overhead was reduced. :) |
As promised, here's the PR: #6906 |
I was getting
Changing
to
fixed the issue |
Haven't managed to get it working. Any updates on this? I'm running babel 7. module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>/src'],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
clearMocks: true,
setupFilesAfterEnv: ['<rootDir>/src/setupEnzyme.ts'],
moduleNameMapper: {
'\\.(gif|ttf|eot|svg)$': '<rootDir>/__mocks__/fileMock.js',
},
}; And my module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
'@babel/preset-typescript',
],
plugins: [
'@babel/proposal-class-properties',
'@babel/proposal-object-rest-spread',
],
}; When running either
With a minimal setup like module.exports = {
testEnvironment: 'node',
transform: {
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
},
moduleDirectories: ['node_modules', 'src'],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}; I get
|
facing this issue...what is the solution? |
I too have this problem.
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
💥 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:
net use x: \\localhost\c$\tmp
x:
and runyarn test
/npm test
Expected behavior
Test suite should pass.
Actual behavior
Resolution fails with different kinds of errors, e.g.:
or
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: