Socket
Socket
Sign inDemoInstall

code-coverage-git-diff

Package Overview
Dependencies
12
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    code-coverage-git-diff

Application used to check code coverage by tests on added lines (ex. check coverage just on new code in PR)


Version published
Weekly downloads
123
increased by11.82%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Git Diff Code Coverage

Build Status airbnb-style npm version

This package is a fork of original

Application used to check code coverage by tests on added lines (ex. check coverage just on new code in PR)

How to use?

  1. Install tool
npm i -D code-coverage-git-diff
  1. Run test to generate coverage report
npm test
  1. Run application to analyze it
gitDiffCodeCoverage --repoPath=$(pwd) --reportPath=artifacts/coverage/coverage-summary.json --fileTemplate=app/**/*.js --source=newBranch --target=master --reportFormat=json -v -m 80

Arguments

Path to folder with initiated git repository (required)

--repoPath, String

Source branch or commit hash (ex. myCoolFeature)

--source, String

Target branch or commit hash (ex. master)

--target, String, defaultValue: 'master'

Path to generated report (json summary coverage report)

--reportPath, String, defaultValue: 'coverage/coverage-summary.json'

Verbose mode (display stats by each file and line)

--verbose, -v

Silent mode (hide all output)

--silent, -s

Minimum overall coverage

--minimumOverallCoverage, -m, Number, defaultValue: 70

Files to analyze

--fileTemplate, -f, String, defaultValue: 'src/**/*.js'

Report format

--reportFormat, String, defaultValue: 'lcov', possible values: 'json', 'lcov'

Areas to improve:

  • Analyse git default output (using data between @@ ... @@)
  • Add other coverage report support
  • Improve coverage
  • Generate pretty output

Keywords

FAQs

Last updated on 10 Mar 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc