mzgoddard / jest-webpack

Use jest with webpack.
https://www.npmjs.com/package/jest-webpack
92 stars 21 forks source link

Fix require paths for config-yargs, convert-argv, SearchSource and createContext #45

Open jonesnc opened 4 years ago

jonesnc commented 4 years ago

Also fixes tests for common-flags.test.js

jonesnc commented 4 years ago

The TravisCI build isn't passing with this error:

$ npm test
> jest-webpack@0.5.1 test /home/travis/build/mzgoddard/jest-webpack
> node ./jest-webpack.js --maxWorkers 1
internal/modules/cjs/loader.js:969
    throw err;
    ^

Error: Cannot find module 'find-up'
Require stack:
- /home/travis/build/mzgoddard/jest-webpack/src/jest-webpack.js
- /home/travis/build/mzgoddard/jest-webpack/jest-webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:17)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/travis/build/mzgoddard/jest-webpack/src/jest-webpack.js:4:16)
    at Module._compile (internal/modules/cjs/loader.js:1139:30)
    at loader (/home/travis/build/mzgoddard/jest-webpack/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.<computed> [as .js] (/home/travis/build/mzgoddard/jest-webpack/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (internal/modules/cjs/loader.js:988:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/travis/build/mzgoddard/jest-webpack/src/jest-webpack.js',
    '/home/travis/build/mzgoddard/jest-webpack/jest-webpack.js'
  ]
}

npm ERR! Test failed.  See above for more details.

The command "npm test" exited with 1.

I think this stems from npm install ... removing some of the packages that yarn installs, including find-up.

jonesnc commented 4 years ago

Replacing npm install ... with yarn add .. in the Travis CI build script will probably fix this issue.