I have a problem with code coverage. This the tests results :
[...]
24 tests passed (24 total in 9 test suites, run time 2.353s)
----------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
----------|----------|----------|----------|----------|----------------|
All files | 100 | 100 | 100 | 100 | |
----------|----------|----------|----------|----------|----------------|
All reports generated
Process finished with exit code 0
All my tests succeed (count 73 expect). But no cover. I'm just testing normal node code. I use babel-jest, here you have the config in package.json :
"scripts": {
"test": "jest"
},
"jest": {
"collectCoverage": true,
"moduleFileExtensions": [
"js",
"json"
],
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
"testDirectoryName": "unit",
"testFileExtensions": [
"js"
],
"testPathDirs": [
"<rootDir>/tests/"
]
}
Here is my project architecture :
./
|-- app
| |-- routes
| | |-- private
| | |-- public
|-- tests
| |-- unit
| | |-- routes
| | | |-- private
| | | |-- public
The tests/unit folder contains the same architecture as app folder as you can see.
Have you an idea about why I don't have any reports ? Thanks in advance !