Jest Webpack Resolver Plugin
It is a jest plugin for enchanging jest resolving behaviour to webpack resolver through any webpack config.
webpack 2 provides some custom resolving opinions for enchanging resolving behaviours like directory-named-webpack-plugin and you can't match this kind of resolves with jest's default resolver and this plugins completely changing resolving rules.
With webpack resolving you don't have to worry about these resolving options:
Jest resolver option supported for jest >=20 versions.
install with yarn
yarn add jest-webpack-resolver -D
or install with npm
npm install jest-webpack-resolver -D
add to your jest configuration
By default plugin tries to detect
webpack.config.js. You can configure it from
jest.config.js (or any other jest config file)
jestWebpackResolver to your
package.json file at root level:
or at your
// ... jestWebpackResolver: webpackConfig: './path/to/webpack.config.js'
to stop the 'Webpack Resolver using: ./...' message use the silent option