-
Notifications
You must be signed in to change notification settings - Fork 58
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
Relative requires broken in Jest tests #53
Comments
It seems like prefixing |
Nevermind, that doesn't fix it, Jest's environment incorrectly returns empty directory contents (which breaks this library) because Jest doesn't support Unfortunately this means that |
Fixed by jestjs/jest#4614. |
Still seeing this in jest 22.1.4 and the latest require-dir |
This is still happening for me with Jest 22.4.2. |
Same for me, Jest 22.4.2 |
Yeah, this is a jest bug. Nothing we can really do from this library - sorry! Open a ticket on the jest repo for it - this also might be related jestjs/jest#5235 |
Currently the problem with Jest lies in https://github.com/aseemk/requireDir/blob/master/index.js#L98. In Jest land I've tried various, hacky solutions via Jest preprocessors as stated in this related issue but they didn't work. I am sorry but I have to switch to |
require-dir is not compatible with jest, but require-directory seems to work aseemk/requireDir#53 (comment)
* Replace require-dir to get jest test working require-dir is not compatible with jest, but require-directory seems to work aseemk/requireDir#53 (comment)
Please refer to jestjs/jest#4567.
It appears that a Jest specific issue causes
require-dir
's module resolution to happen relatively to the test package instead of the parent package. This causes dependents ofrequire-dir
, includingnpm-check-updates
, to break when used in Jest tests.The text was updated successfully, but these errors were encountered: