# jest-badge-generator

> Create a group of coverage badges from jest to an output folder

Latest version **1.1.5** (published 2020-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install jest-badge-generator
pnpm add jest-badge-generator
yarn add jest-badge-generator
bun add jest-badge-generator
```

Provides the command `jest-badge-generator`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2020-01-18 |
| First published | 2020-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vinicios Clarindo |
| Maintainers | vinicioslc |

## Links

- npm: https://www.npmjs.com/package/jest-badge-generator
- npm.io page: https://npm.io/package/jest-badge-generator

## Dependencies (2)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [svg-to-png](https://npm.io/package/svg-to-png.md) ^4.0.0

## Recent versions

- 1.1.5 (latest) — 2020-01-18
- 1.0.5 — 2020-01-07
- 1.0.4 — 2020-01-07
- 1.0.3 — 2020-01-07
- 1.0.2 — 2020-01-07
- 1.0.1 — 2020-01-05
- 1.0.0 — 2020-01-05

## README

# Jest Badges Generator

This has inteded to be an package that generates jest badges to be used by your README.md or something like.

By default all badges are sended to `.badges` the files will be something like.. 

> has option for convert to png too...

`badge-branches.svg` ![coverage-branches](https://github.com/vinicioslc/jest-badge-generator/raw/master/.badges/badge-branches.svg?sanitize=true)

`badge-functions.svg` ![coverage-function](https://github.com/vinicioslc/jest-badge-generator/raw/master/.badges/badge-functions.svg?sanitize=true)

`badge-lines.svg` ![coverage-lines](https://github.com/vinicioslc/jest-badge-generator/raw/master/.badges/badge-lines.svg?sanitize=true)

`badge-statements.svg` ![coverage-statements](https://github.com/vinicioslc/jest-badge-generator/raw/master/.badges/badge-statements.svg?sanitize=true)


## How to

0. Install this package as development dependency `npm i jest-badge-generator -D`

1. you will need add follwing config to your jest tests section in `package.json` or in your `jest.config.js`

````json
...
  "scripts": {
    "test": "jest --coverage",
    "test:make-badges": "npm run test && jest-badge-generator" // you have the options argument to convert for png with `jest-badge-generator --type "png"` this will convert output svg to png
  },
  "jest": {
    "coverageReporters": [
        "json",
        "json-summary",
        "lcov",
        "text",
        "text-summary"
    ],
    "testPathIgnorePatterns": [
        "/node_modules/"
    ],
    "testRegex": "(/__tests__/.*|\\.(test|spec))\\.jsx?$"
  },
...
````

2. Run the tests `npm run test:make-badges`

## Library Jest Health Summary

![coverage-branches](https://github.com/vinicioslc/jest-badge-generator/raw/master/.badges/badge-branches.png?sanitize=true)
![coverage-function](https://github.com/vinicioslc/jest-badge-generator/raw/master/.badges/badge-functions.png?sanitize=true)
![coverage-lines](https://github.com/vinicioslc/jest-badge-generator/raw/master/.badges/badge-lines.png?sanitize=true)
![coverage-statements](https://github.com/vinicioslc/jest-badge-generator/raw/master/.badges/badge-statements.png?sanitize=true)

---
_Source: https://npm.io/package/jest-badge-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
