By default the collectCoverage option for jest is set to false. The easiest way to get an HTML coverage report is to configure jest in either package.json or jest.config.js. You will also need to set the coverageDirectory in the config as well.
There are several different configuration options for coverage reporting. See here for all config settings: https://jestjs.io/docs/en/configuration.html#collectcoverage-boolean
Here is an example of how to configure jest in package.json with a few options.
{
"name": "appname",
"version": "1.0.0",
"description": "description",
"main": "index.js",
"scripts": {
"test": "jest",
"postinstall": "jspm install"
},
"jest": {
"scriptPreprocessor": "./preprocessor.js",
"testPathIgnorePatterns": [
"/node_modules/",
],
"unmockedModulePathPatterns": [
"./node_modules/react"
],
"collectCoverage": true,
"coverageDirectory": "path/to/coverage/reports",
},
"author": "author",
"license": "ISC",
"dependencies": {
"del": "^1.1.1",
"gulp": "^3.8.11",
"gulp-filter": "^2.0.2",
"gulp-load-plugins": "^0.10.0",
"gulp-react": "^3.0.1",
"gulp-shell": "^0.4.1",
"harmonize": "^1.4.1",
"jest-cli": "^0.4.1",
"jspm": "^0.15.5",
"react": "^0.13.2",
"react-tools": "^0.13.2",
"run-sequence": "^1.1.0"
},
"devDependencies": {
"browser-sync": "^2.7.1",
"gulp": "^3.8.11"
},
"jspm": {
"directories": {},
"dependencies": {
"react": "npm:react@^0.13.2"
},
"devDependencies": {
"babel": "npm:babel-core@^5.1.13",
"babel-runtime": "npm:babel-runtime@^5.1.13",
"core-js": "npm:core-js@^0.9.4"
}
}
}
Now when you run your test with jest --coverage the HTML reports will be generated in the specified directory.