You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Jest CLI v0.9.2, jasmine2, babel-jest
FAIL __tests__/components/CoolComponent.js
● Runtime Error
Error: Cannot find module './package' from 'index.js'
at Loader._resolveNodeModule (/home/nils/Programmering/relay/phoenix-hipster-stack/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:431:11)
at Object.<anonymous> (/home/nils/Programmering/relay/phoenix-hipster-stack/node_modules/cheerio/index.js:11:19)
at Object.<anonymous> (/home/nils/Programmering/relay/phoenix-hipster-stack/node_modules/enzyme/build/ReactWrapper.js:13:16)
Running Ubuntu 15.10
The text was updated successfully, but these errors were encountered:
If you are using webpack, you can work around this issue by putting in the following plugin configuration:
plugins: [
// other plugins that you need
new NormalModuleReplacementPlugin(/^\.\/package$/, function(result) {
if(/cheerio/.test(result.context)) {
result.request = "./package.json"
}
})
]
This looks for any require("./package") in the cheerio module path, and replaces it with require("./package.json")
i had to change
exports.version = require('./package').version;
to
exports.version = require('./package.json').version;
in
https://github.com/cheeriojs/cheerio/blob/master/index.js
Otherwise i got this error
Running Ubuntu 15.10
The text was updated successfully, but these errors were encountered: