node -v: 8.11.4npm -v: 5.6.0npm ls jest or npm ls react-scripts (if you haven鈥檛 ejected): [email protected]//jest.config.js
module.exports = {
moduleNameMapper: {
'@/(.*)$': '<rootDir>/src/$1',
'neo/(.*)$': '<rootDir>/neo/$1',
},
testEnvironment: 'node',
setupTestFrameworkScriptFile: './test/bootstrap.js',
verbose: false,
};
//package.json
"scripts": {
...
"test": "jest --runInBand src",
"test:setup": "babel-node build/jest_build_test_files.js",
"test:watch": "jest --runInBand --watch server",
"coverage": "jest --collectCoverageFrom=server/**.js --coverage server"
},
npm run testTo run the tests with same options defined in my package.json and get the same results when I run in command line (npm run test)
When I start Jest runner, it finds some errors because the tests are run in parallel (not with --runInBand)
The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...
if you expect this plugin to run npm run test but haven't configured the jest.pathToJest accordingly, chances are it is not using it... You can check it yourself by turning on the debug mode to see the exact command the runner is using.
Thank you. It's working now as expected.
In settings, I added:
jest.pathToJest = node_modules/.bin/jest --runInBand
great!
Most helpful comment
Thank you. It's working now as expected.
In settings, I added:
jest.pathToJest = node_modules/.bin/jest --runInBand