Gathering detailed insights and metrics for node-jest-badges
Gathering detailed insights and metrics for node-jest-badges
Gathering detailed insights and metrics for node-jest-badges
Gathering detailed insights and metrics for node-jest-badges
node-coverage-badges
Generating coverage badges from jest
generator-blip-api-kates
Yeoman generator for BLiP apis projects with helm and kubernetes.
@npmteam2024/praesentium-eveniet-ipsam
](https://www.npmjs.com/package/@hutechwebsite/quo-est-iure-quam) [](https://
npm install node-jest-badges
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (81.82%)
JavaScript (18.18%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
4 Stars
176 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Feb 13, 2024
Latest Version
1.3.17
Package Id
node-jest-badges@1.3.17
Unpacked Size
25.60 kB
Size
7.29 kB
File Count
42
NPM Version
10.2.4
Node Version
20.11.0
Published on
Feb 13, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
29
Generating coverage badges from jest coverage report.
Let's just imagine you want to display some information about your testing coverage and you're using jest as a testing framework. Look no further!
This package generates the following badges for you, based on the coverage report generated by jest, using instanbul.
Badge | Description |
---|---|
Percentage of DD-paths followed during tests | |
Percentage of functions executed within tests | |
Percentage of lines covered by tests | |
Percentage of statements executed within tests | |
Average of the above coverage percentages |
If you want to integrate this to your CI/CD, you have a github action available for this.
Well, let's just start by stating the obvious here. Yes, you will need jest testing library to use this package.
1yarn add -D node-jest-badges
or
1npm i -D node-jest-badges
You will need to add json-summary to coverage reporters in jest config:
1module.exports = { 2 coverageReporters: ["json-summary"]; 3};
You have two ways to generate coverage badges: cli and node. Both will create a folder where .svg files will be written.
You can add a script to your package.json like so:
1 "scripts": { 2 "badges": "generateBadges" 3 },
The generateBadges
function accepts two optional arguments to specify:
1// will generate badges from './coverage/coverage-summary.json' in './badges' (default) 2yarn generateBadges 3 4// will generate badges from './myModule/coverage-summary.json' in './cool' folder. 5yarn generateBadges -c ./myModule/coverage-summary.json -o ./cool
Another way is to directly use the package:
1import { generateBadges } from 'node-jest-badges'; 2 3(async () => { 4 // will generate badges from './coverage/coverage-summary.json' in './badges' (default) 5 await generateBadges(); 6})();
The function optionally accepts two arguments to specify a custom path for the json summary file and the output path:
1import { generateBadges } from 'node-jest-badges'; 2 3(async () => { 4 // will generate badges from './myModule/coverage-summary.json' in './cool' 5 await generateBadges('./myModule/coverage-summary.json', './cool'); 6})();
Big thanks to Shield for this awesome tool!
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
9 existing vulnerabilities detected
Details
Reason
project is archived
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More