jest-cli code coverage only shows zero percent

Viewed 1236

For some reason, in my new project, my test coverage always shows as 0% even though there are tests and they are clearly running.

Test Suites: 3 failed, 4 passed, 7 total
Tests:       4 failed, 21 passed, 25 total
Snapshots:   0 total
Time:        1.849s, estimated 2s
Ran all test suites.

=============================== Coverage summary ===============================
Statements   : 0% ( 0/663 )
Branches     : 0% ( 0/285 )
Functions    : 0% ( 0/117 )
Lines        : 0% ( 0/496 )
================================================================================

Is there something wrong with my configuration? My test files are in __tests__ and here is the jest configuration in my config file.

 "jest": 

{
      "automock": true,
      "collectCoverage": true,
      "collectCoverageFrom": [                                                                                                                                                                                                                                                                                                                                          
        "src/js/**/*.js"
      ],
      "coverageReporters": [
        "lcov",
        "text-summary"
      ],
      "coveragePathIgnorePatterns": [
        "<rootDir>/node_modules/"
      ],
      "unmockedModulePathPatterns": [
        "/node_modules/keymirror",
        "serialport"
      ]
}
1 Answers
Related