Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@connectis/diff-test-coverage
Advanced tools
Commandline tool which calculates test coverage of (source control) diffs.
A Node.js commandline tool which filters test coverage based on a (source control) diff.
Supported coverage report formats:
Supported source control systems:
npm i -g @connectis/diff-test-coverage
Execute diff-test-coverage
to see the documentation.
Usage:
1. Execute your tests to generate your test coverage reports.
2. Figure out what Git or Mercurial command to use to generate your diff (see Examples below).
3. Execute: <diff command> | diff-test-coverage -c <coverage report glob> -t <coverage report type> --
Options:
--help Show help [boolean]
--version Show version number [boolean]
-c, --coverage Glob pattern(s) that specify which coverage report files to use. [array] [required]
-t, --type The type of coverage report. When provided multiple times the types will be mapped to the matching coverage glob patterns. [array] [required] [choices: "lcov", "cobertura", "clover", "jacoco", "golang-cover"]
-l, --line-coverage Required line coverage percentage on the diff. The application will exit with -1 if this is not reached. [number] [default: 80]
-b, --branch-coverage Required branch coverage percentage on the diff. The application will exit with -1 if this is not reached. [number] [default: 80]
-f, --function-coverage Required function coverage percentage on the diff. The application will exit with -1 if this is not reached. [number] [default: 80]
--diff-base-dir The base directory for resolving relative paths in the diff. Uses current working directory by default. [string] [default: `process.cwd()`]
--diff-filter Glob pattern(s) that specify which files from the diff should be included. [array]
--log-base-dir The base directory for resolving relative paths in the console logger. Uses current working directory by default. [string] [default: `process.cwd()`]
--log-template The information which should be logged to the console. [array] [choices: "diff-files", "coverage-files-line", "coverage-files-complete", "totals-line", "totals-complete", "errors"] [default: ["coverage-files-complete","totals-complete","errors"]]
--color Whether colors should be used in the log. Default: autodetect by 'chalk'. [boolean]
Examples:
git diff master...MY-BRANCH | diff-test-coverage -c **/coverage.xml -t cobertura -- Runs 'diff-test-coverage' with a git diff and Cobertura coverage reports.
hg export -r "branch(.) and not merge()" | diff-test-coverage -c **/target/site/jacoco/jacoco.xml -t jacoco -- Runs 'diff-test-coverage' with a mercurial diff and Jacoco coverage reports.
<diff command> | diff-test-coverage --log-template diff-files coverage-files-line totals-line errors <other args> -- Runs 'diff-test-coverage' with custom logging.
<diff command> | diff-test-coverage --diff-filter *.java *.kt --log-template diff-files coverage-files-complete totals-complete errors <other args> -- Runs 'diff-test-coverage' with the diff filtered on Java and Kotlin files.
<diff command> | diff-test-coverage --no-color <other args> -- Runs 'diff-test-coverage' without color in the log.
git diff master...MY-BRANCH Creates a diff of the Git branch 'MY-BRANCH' which originated from the master branch.
hg export -r "branch(.) and not merge()" Creates a diff of the current Mercurial branch, excluding any merge commits.
hg export -r "branch(MY-BRANCH) and not merge()" Creates a diff of the Mercurial branch MY-BRANCH, excluding any merge commits.
FAQs
Commandline tool which calculates test coverage of (source control) diffs.
The npm package @connectis/diff-test-coverage receives a total of 4,298 weekly downloads. As such, @connectis/diff-test-coverage popularity was classified as popular.
We found that @connectis/diff-test-coverage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.