I\'m doing some slightly bizarre stuff using Jest for testing where I\'m writing some stuff to disk. If I use the watch
flag in Jest however then I\'m finding (quit
To exclude a directory from Jest testing, use testPathIgnorePatterns
testPathIgnorePatterns
"testPathIgnorePatterns": ["directory to ignore"]
Below in file package.json, I have configured to ignore the "src" directory
{
"name": "learn-test",
"jest": {
"testPathIgnorePatterns": ["src"]
},
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-scripts": "1.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "jest --watch",
"eject": "react-scripts eject",
},
"devDependencies": {}
}