-
-
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
unmockedModulePathPatterns can not detect module path #100
Comments
I'm getting the same thing, except I'm on OSX. My setup is a little difference since I'm redefining rootDir. "jest": {
"rootDir": "./app/web/modules",
"moduleFileExtensions": ["js", "jsx"],
"scriptPreprocessor": "../../../preprocessor.js",
"unmockedModulePathPatterns": ["../../../node_modules/react"]
} Here is my directory structure
The path to preprocessor is correct and runs the preprocessor script fine. Edit I added "react" to the unmockedModulePathPatterns array and it seems to be including fine now... "unmockedModulePathPatterns": ["react"] |
yes, setting |
Interesting, I wonder if there's a normalization problem when rootDir isn't left at the default... I'm coming back from a pretty long vacation and I have quite a few issues to slog through, so it may be a bit of time before I can dive into this myself. However, if you want to dive in I'd be happy take answer questions or take any PRs in the meantime :) Pro-tip: If you run |
I'll try and take a look at this one so. I'm not having a lot of luck with node-inspector though. It's quite temperamental, only occasionally loading the jest scripts in the debugger window. I have tried a few ways
Am I doing something wrong here? Sorry, don't have much experience with node-inspector. Just going from the docs |
I'm having the same issue, and changing the
|
I'm seeing this error sporadically in our Travis build. I've seen trivial changes make this error appear & disappear, so I assume it's flakiness. Examples: https://travis-ci.org/hammerlab/cycledash/builds/38193754 (failed) |
@dheniges thanks. After removing relative path it started working on my Windows 7. |
unmockedModulePathPatterns are used internally by Jest to create a RegExp against which all required modules will be tested. As such, you need to provide a valid regex pattern.
|
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed. |
|
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. |
Think this might be related to closed issue #88
I'm using a windows machine. Any time I try to require an external module, be it in node_modules, or any folder relative to the spec file, I receive an npm error
Found 1 matching tests...
FAIL tests\xxx.spec.js
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
There was no more debug information available so I reduced my spec file to a single line
var React = require('react');
and found that it was failing when trying to require react module.My package.json file seems to be in order at least according to the example in the docs.
Here's a section of it
My directory structure looks something like this so the
<rootDir>
should default to where package.json is. And it should be able to find react library from unmockedModulePathPatterns providedI debugged the source code and found that there is an error that is getting swallowed on requiring React at node_modules\lib\ReactCompositeComponent.js: Cannot read property 'DEFINE_MANY' of undefined - which would suggest to me that Jest is ignoring the unmockedModulePathPatterns
The text was updated successfully, but these errors were encountered: