TypeScript coverage report
Node command tool to generate TypeScript coverage report.
Background
This package fills the gap of a missing type coverage reporting tool which is present in the Flow ecosystem, strongly inspired by the amazing work done by flow-coverage-report
and using data generated by type-coverage
.
See Also
I've published an article on How I built a TS coverage report tool, which explains more the roadmap and the resoning.
Install
You can install it globally or locally.
My advice is to install it as a project dependency and create a script in your package.json
.
yarn add --dev typescript-coverage-tool
# npm users
npm install --save-dev typescript-coverage-tool
Usage
If you installed locally, add this in your scripts section of the package.json
.
"scripts": {
"ts-coverage": "typescript-coverage-report"
}
Then run:
yarn ts-coverage
# npm users
npm run ts-coverage
To set the threshold (80% by default) required, use the --threshold
option.
yarn ts-coverage --threshold=99
or, following the type-coverage configuration
, you can specify it in your package.json
.
"typeCoverage": {
"atLeast": 90
}
Options
The CLI accepts a list of arguments:
Option | Description | Default value |
---|
-t, --threshold [number] | The minimum percentage of coverage required. | 80 |
-o, --outputDir [string] | The output directory where to generate the report. | coverage-ts |
-s, --strict [boolean] | Run the check in strict mode. | false |
-d, --debug [boolean] | Show debug information. | false |
Maintainers
@alexcanessa
Contributing
Feel free to dive in! Open an issue or submit PRs.
On this project we follow the Contributor Covenant Code of Conduct.
Commit messages
This project follows the Angular commit messages, but it's very open to emojis 🤯.
Licence
MIT @ Alessandro Canessa