I am manually setting-up for jest.
My repo struture:
my-proj
- src
- components
...
- accordion
- index.jsx
- tests
- components
- accordion.test.js
- setupTests.js
- package.json
When I run npm run test-coverage
to get the test coverage, it only returns the files I've tested but not all files inside /src
.
package.json
"scripts": {
"test": "jest --watchAll",
"test-coverage": "jest --coverage",
},
"jest": {
"moduleDirectories": [
"node_modules",
"src"
],
"moduleNameMapper": {
"\\.(css|scss)$": "identity-obj-proxy"
},
"setupFilesAfterEnv": [
"<rootDir>/src/setupTests.js"
],
"snapshotSerializers": [
"enzyme-to-json/serializer"
]
},
accordion.test.js
. What did you expect? – Kenrick