Open lucasriondel opened 5 years ago
Seeing the same issue with:
"jest": "^24.7.1",
"jest-webpack-resolver": "^0.3.0",
Seems the easiest workaround here is to just rename/move your webpack config to the default or just create a symlink or something :)
That works but in turn has an annoying side effect where Webpack Resolver couldn't find any configuration. Tries to resolve ./webpack.config.js
gets logged every time...
what do you mean when you say move to default. can you tell more ?
I was able to resolve the Validation Warning: Unknown option "jestWebpackResolver" by moving this value from jest.config.js :
"jestWebpackResolver": {
"silent": true,
"webpackConfig": "webpack.config.js"
}
to package.json.
Leaving these values in my jest.config.js:
module.exports = {
moduleNameMapper: {
"\\.css$": "<rootDir>/__mocks__/styleMock.js"
},
resolver: "jest-webpack-resolver",
setupFilesAfterEnv: ['<rootDir>/src/setUpTests.js']
}
using:
"jest": "^26.4.2",
"jest-webpack-resolver": "^0.3.0",
@Shripad03 I meant just webpack.config.js
as a workaround but the solution provided by @patrick-s-young works perfectly!
@alexweber the Jest issue came up during a React boilerplate project. I wanted to support directory aliasing across Webpack / TypeScript / ESLint / and Jest: https://github.com/patrick-s-young/react-ts-eslint-webpack-babel
If you have any feedback for improving it, please let me know.
First of all, thanks for your package. It works like a charm.
But I have a small issue... I have to set a path to my webpack config, or else I have the following message:
So I did like you said in the Readme, and i added the following to my jest.config.json:
Which works. But when i launch jest, i have the following message:
Which is really weird. Do you have any idea why ?
(using jest ^23.6.0)