Giter Site home page Giter Site logo

zilong-thu / typescript-coverage-report Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexcanessa/typescript-coverage-report

0.0 0.0 0.0 3.56 MB

Node command tool to generate TypeScript coverage report

License: MIT License

TypeScript 72.07% JavaScript 26.16% CSS 1.78%

typescript-coverage-report's Introduction

TypeScript Coverage Report

npm version npm downloads standard-readme compliant MIT Licence Automated Release Notes by gren

All Contributors

Node command line tool for generating TypeScript coverage reports ✨

Overview

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 an example of the coverage report.

Background

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

Install

typescript-coverage-report can be installed locally or globally.

Users are advised to install it as a project (dev) dependency and create a script in package.json.

$ yarn add --dev typescript-coverage-report

# OR

$ npm install --save-dev typescript-coverage-report

Usage

If installed locally, add the following to the scripts section of package.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 the type-coverage configuration, specified in package.json.

"typeCoverage": {
  "atLeast": 90
}

terminal table

summary page

details page

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
-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

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.

Developing

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

Commit messages

This project follows the Angular commit messages, but it's very open to emojis 🤯.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


David Tsai

📖 🐛

Alexis Tyler

🐛

Dan Vanderkam

💻

Daniel Edholm Ignat

💻

Kyℓe Hensel

💻

Danilo Cabello

💻

Sanjay Guruprasad

🐛

Luis Helder

🐛

Tom Ardern

🐛 💻

lroskoshin

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Licence

MIT @ Alessandro Canessa

forthebadge

typescript-coverage-report's People

Contributors

alexcanessa avatar allcontributors[bot] avatar dependabot[bot] avatar danvk avatar dignite avatar cabello avatar k-yle avatar tomardern avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.