-
-
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
Fix roots on Windows #9549
Fix roots on Windows #9549
Conversation
I noticed that on Windows, if you had one bad route in your jest.config.js, it would return 0 route found. It looked like a bug to me, because this was not what happened on Linux, and there was no error message directly saying a route was wrong. This simple fix ensure that all routes are checked and registered in the result array before returning anything to callback. What was happening is that the calls being asynchronous and the error check being at the beginning, when it encountered a bad route, it would return the callback and ignore the other route, wich could be ok.
Codecov Report
@@ Coverage Diff @@
## master #9549 +/- ##
==========================================
- Coverage 65.05% 65.03% -0.03%
==========================================
Files 286 286
Lines 12123 12124 +1
Branches 3004 3005 +1
==========================================
- Hits 7887 7885 -2
- Misses 3599 3600 +1
- Partials 637 639 +2
Continue to review full report at Codecov.
|
Seems odd to me that we just ignore errors... This fix seems correct though. @cpojer thoughts? |
I think this could benefit from tests. |
To reproduce the case:
|
Actually, I'm sorry. If you want tests, I don't know how to do them for this type of code, I can only tell you of to reproduce the error, like I did earlier. |
Looked into this, and if you provide a non-existent I think all of these behaviors except for watchman's are bugs (and since it fallbacks to a bug, even that behaviour is wrong). IMO the correct solution is to validate that all directories provided as I also think we should error in |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I noticed that on Windows, if you had one bad route in your jest.config.js, it would return 0 route found.
It looked like a bug to me, because this was not what happened on Linux, and there were no error message directly saying a root was wrong.
This simple fix ensure that all roots are checked and registered in the result array before returning anything to callback. What was happening is that the calls being asynchronous and the error check being at the beginning, when it encountered a bad root, it would return the callback and ignore the other roots, which could be ok.
Summary
Test plan