Reputation: 1620
The issue I'm facing is the lack of report tables in my terminal once I run my npm test
.
I know for a fact that the reports are being generated, since I can see the files in the coverage
directory.
However, it's a bit annoying and despite my debugging, I can't seem to find out what the issue is.
Here is my jest.config.js:
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/en/configuration.html
*/
module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
reporters: [
"default",
[
"jest-junit",
{
outputDirectory: "./coverage",
outputName: "unit_tests_coverage.xml",
},
],
],
// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: ["cobertura", "lcov"],
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
maxWorkers: "50%",
// A list of paths to directories that Jest should use to search for files in
roots: ["test"],
testEnvironment: "node",
// Options that will be passed to the testEnvironment
// testEnvironmentOptions: {},
testRegex: ["/test/.*\\.(test|spec)?\\.(ts|tsx)$"],
transform: {
"^.+\\.ts?$": ["babel-jest"],
},
}
At the end of every test execution, I get like a summary like this:
Test Suites: 9 passed, 9 total
Tests: 155 passed, 155 total
Snapshots: 0 total
Time: 10.248 s
But no table showing line coverage, branch coverage... etc.
Is my jest.config.js incorrect or am I missing something?
Thanks in advance for your help!
Upvotes: 1
Views: 3549