When I run my Jest tests, around 80% of them fail due to the
cannot find resolver for: <config.name>
at getResolver (../node_modules/jest-runner/build/testWorker.js:153:11)
I have tried to run the test with the argument runInBand and it seems to work just fine, the issue is when I try to run the test with the default multithread.
- Is there a possibility that I broke something with the
jest.config? - I do not want to run the tests on a single thread
Jest version - 24.8.0
jest.config
module.exports = {
clearMocks: true,
collectCoverage: true,
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: [
'/node_modules/',
'<rootDir>/src/utils/'
],
coverageReporters: [
'json',
'html',
'text',
'lcov'
],
coverageThreshold: {
'global': {
'branches': 35,
'functions': 41,
'lines': 55,
'statements': 53
}
},
globals: {
_: require('lodash')
},
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/../src/utils/__mocks__//fileMock.js',
'\\.(css|less|jsf)$': '<rootDir>/../src/utils/__mocks__/styleMock.js',
'(flags|devices)$': '<rootDir>/../src/utils/__mocks__/styleMock.js'
},
roots: [
'../'
],
setupFiles: [
'<rootDir>/jest.init.js'
],
snapshotSerializers: ['enzyme-to-json/serializer'],
testEnvironment: 'node',
testMatch: [
'**/__tests__/**/*.spec.js?(x)',
'**/?(*.)+(spec|test).js?(x)'
],
testPathIgnorePatterns: [
'/node_modules/',
'/test/'
],
transformIgnorePatterns: [
'/node_modules/(?!webapps-frontend-components).+(js|jsx)$'
]
}
jest.init
import 'babel-polyfill'
import React from 'react'
import Enzyme, { shallow, render, mount } from 'enzyme'
import Adapter from 'enzyme-adapter-react-15'
Enzyme.configure({ adapter: new Adapter() })
global.React = React
global.shallow = shallow
global.render = render
global.mount = mount