- Notifications
You must be signed in to change notification settings - Fork33
Node command tool to generate TypeScript coverage report
License
alexcanessa/typescript-coverage-report
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Node command line tool for generating TypeScript coverage reports ✨
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 byflow-coverage-report
and using data generated bytype-coverage
.
See an example of the coverage report.
To learn more about the reasoning behind this project and its roadmap, please refer to the following article:How I built a TS coverage report tool
typescript-coverage-report
can be installed locally or globally.
Users are advised to install it as a project(dev) dependency and create a script inpackage.json
.
$ yarn add --dev typescript-coverage-report# OR$ npm install --save-dev typescript-coverage-report
If installed locally, add the following to thescripts section ofpackage.json
.
"scripts": {"ts-coverage":"typescript-coverage-report"}
Then run:
$ yarn ts-coverage# OR$ npm run ts-coverage
To set the minimum threshold(80% by default), use the--threshold
option.
$ yarn ts-coverage --threshold=99
As an alternative, options may be provided through thetype-coverage
configuration, specified inpackage.json
.
"typeCoverage": {"atLeast":90}
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 |
-c, --cache [boolean] | Save and reuse type check result from cache. | false |
-p, --project [string] | File path to tsconfig file, eg: --project "./app/tsconfig.app.json" | . |
-i, --ignore-files [boolean] | Ignore specified files, eg: --ignore-files "demo1/*.ts" --ignore-files "demo2/foo.ts" | false |
-u, --ignore-unread [boolean] | Allow writes to variables with implicit any types | false |
Feel free to dive in!Open an issue or submit PRs.
On this project we follow theContributor Covenant Code of Conduct.
Thanks for contributing!
Remember to run the following commands to link your version of this package and build the TypeScript files.
# Link the package globally, so you'll be able to test it in other projects.$ yarn link# Builds the TypeScript files and watches for changes$ yarn build --watch
This project follows theAngular commit messages, but it's very open to emojis 🤯.
Thanks goes to these wonderful people (emoji key):
This project follows theall-contributors specification. Contributions of any kind welcome!
MIT @ Alessandro Canessa
About
Node command tool to generate TypeScript coverage report
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.