All Projects → olavoparno → jest-badges-readme

olavoparno / jest-badges-readme

Licence: MIT license
Creates a group of coverage badges from Jest into your README

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jest-badges-readme

istanbul-badges-readme
Creates and updates README testing coverage badges with your json-summary
Stars: ✭ 77 (+156.67%)
Mutual labels:  readme, coverage, istanbul, jest-badges-readme
Codeigniter Schema
⛔️DEPRECATED Expressive table definitions
Stars: ✭ 87 (+190%)
Mutual labels:  deprecated, archived, obsolete
Sphero Mac Sdk
🚫 DEPRECATED: Sphero SDK for the Mac platform.
Stars: ✭ 70 (+133.33%)
Mutual labels:  deprecated, archived, obsolete
Closure Linter
Automatically exported from code.google.com/p/closure-linter
Stars: ✭ 104 (+246.67%)
Mutual labels:  deprecated, archived, obsolete
Mern Starter
⛔️ DEPRECATED - Boilerplate for getting started with MERN stack
Stars: ✭ 5,175 (+17150%)
Mutual labels:  deprecated, archived, obsolete
Codeigniter Base Model
⛔️DEPRECATED CodeIgniter base CRUD model to remove repetition and increase productivity
Stars: ✭ 1,052 (+3406.67%)
Mutual labels:  deprecated, archived, obsolete
Secretary
DEPRECATED Secrets management for dynamic environments
Stars: ✭ 93 (+210%)
Mutual labels:  deprecated, archived, obsolete
Aawindow
[Deprecated] · UIWindow subclass to enable behavior like adaptive round-corners & detecting when Control Center is opened.
Stars: ✭ 486 (+1520%)
Mutual labels:  deprecated, archived, obsolete
Python Firebase
⛔️ [DEPRECATED] python wrapper for Firebase's REST API
Stars: ✭ 117 (+290%)
Mutual labels:  deprecated, archived, obsolete
Sphero Android Sdk
🚫 DEPRECATED REPO: Sphero™ is the amazing robotic ball ( gosphero.com ), this is the repository for the Android SDK for Sphero™. Visit dev site for more information:
Stars: ✭ 160 (+433.33%)
Mutual labels:  deprecated, archived, obsolete
microsoft-teams-faqplusplus-app
DEPRECATED - This repository contains a deprecated version of the FAQ Plus app template. Please see the README file for more details and a link to the new repository
Stars: ✭ 47 (+56.67%)
Mutual labels:  deprecated, archived, obsolete
Sphero Ios Sdk
🚫 DEPRECATED: Sphero™ is the amazing robotic ball ( sphero.com ) created by Orbotix, this is the repository for the iOS SDK for Sphero™. Visit dev site for more information:
Stars: ✭ 232 (+673.33%)
Mutual labels:  deprecated, archived, obsolete
Docker Cleanup
DEPRECATED Automatic Docker image, container and volume cleanup
Stars: ✭ 582 (+1840%)
Mutual labels:  deprecated, archived, obsolete
Graphql Modules
⚠️ [DEPRECATED] GraphQL module library for Apollo.
Stars: ✭ 53 (+76.67%)
Mutual labels:  deprecated, archived, obsolete
Mern Cli
⛔️ DEPRECATED - A cli tool for getting started with MERN
Stars: ✭ 575 (+1816.67%)
Mutual labels:  deprecated, archived, obsolete
Julian
⛔️DEPRECATED Brilliantly clever PHP calendar class
Stars: ✭ 89 (+196.67%)
Mutual labels:  deprecated, archived, obsolete
Tinx
⛔️ Laravel Tinx is archived and no longer maintained.
Stars: ✭ 437 (+1356.67%)
Mutual labels:  deprecated, archived, obsolete
Pygeoip
DEPRECATED: Pure Python API for Maxmind's binary GeoIP databases
Stars: ✭ 483 (+1510%)
Mutual labels:  deprecated, archived, obsolete
Codeigniter Base Controller
⛔️DEPRECATED CodeIgniter base controller with view autoloading and layout support
Stars: ✭ 115 (+283.33%)
Mutual labels:  deprecated, archived, obsolete
Terraintoolsamples
Unity has archived the TerrainToolSamples repository. For future development, please use the Terrain Tools package.
Stars: ✭ 195 (+550%)
Mutual labels:  deprecated, archived, obsolete

Deprecated

Please use istanbul-badges-readme instead.

The usage has not changed at all, it has only been made simpler and hopefully bug free.

Jest Badges Readme

CodeClimate DevDeps GitHub license npm version PRs Welcome BuiltBy ForTheBadge

Creates Jest Coverage badges for your README.md file

Statements Branches Functions Lines Build Status
Statements Branches Functions Lines BuildStatus

TL;DR

  • To be short, all it does is: Creates your README.md dynamically with your Jest Coverage Badges based on your README-template.md file

Installation

  • Global Installation

      npm i -g @olavoparno/jest-badges-readme
  • Local Installation

      npm i @olavoparno/jest-badges-readme --save-dev

Configuration and requirements

  1. Have Jest installed and with its Coverage Reporting configuration as below
  • It may be set inside your Jest config within package.json or inside your jest config file i.e. jest.config.js or jestconfig.json

      "coverageReporters": [
        "json-summary",
        "lcov"
      ]
  1. Have a README-template.md file created with the following template (please do feel free to change its presentation structure, e.g. in a table or not)
| Statements | Branches | Functions | Lines |
| -----------|----------|-----------|-------|
| ![Statements](#statements# "Make me better!") | ![Branches](#branches# "Make me better!") | ![Functions](#functions# "Make me better!") | ![Lines](#lines# "Make me better!") |
  1. Call if from your terminal or from your NPM/YARN Scripts
  • For locally installed library

      "make-badges": "node_modules/.bin/jest-badges-readme"
  • For globally installed library

      "make-badges": "npm run jest-badges-readme"
  • You may also provide a different coverage folder path passed as arguments

      "make-badges": "npm run jest-badges-readme --coverageDir='./my-custom-coverage-folder'"
  • And finally via the very terminal

      jest-badges-readme --coverageDir='./my-custom-coverage-folder'

Short summary onto what Jest and Jest Badges Readme covers for us

  • % Stmts (which states for Statements)
  • % Branch (pretty self explanatory)
  • % Functions (won't repeat myself)
  • % Lines (last but not least)

This library will create badges URLs for these former 4 items into your README-template.md if you followed the previous steps

  • Open up your README-template.md and add 4 markers inside it for each Jest coverage item respectively. These markers must be as follows:

    1. '#statements#'
    2. '#branches#'
    3. '#functions#'
    4. '#lines#'

If you feel you might need a local building badge indicator, add these NPM scripts in order to manage your local building badge as well

  "prebuild": "echo nok > .buildstatus",
  "postbuild": "echo ok > .buildstatus"
  • Add one more marker like the example below. This is going to create a file called .buildstatus in your project's root telling this library if your build is either successful or a failure
    1. '#buildstatus#'

Example of README-template.md with building status too

| Statements | Branches | Functions | Lines | Build Status |
| -----------|----------|-----------|-------| ------------ |
| ![Statements](#statements# "Make me better!") | ![Branches](#branches# "Make me better!") | ![Functions](#functions# "Make me better!") | ![Lines](#lines# "Make me better!") | ![BuildStatus](#buildstatus# "Building Status") |

Using as a part of your githooks

  • If you want to have this run on the precommit hook and update the commit in place, just install husky and add the precommit script to your package.json
  1. Install Husky
  npm install --save-dev husky 
  1. Add your precommit script
  "husky": {
    "hooks": {
      "pre-commit": "jest && node_modules/.bin/jest-badges-readme && git add 'README.md'"
    }
  }
  1. Git Commit and Push. Just use your workflow as usual. If your tests fail, no commit. If they pass, update the README.md and add the file to the commit. Nice!

Contributing

The purpose of this library is to motivate developers to constantly write a solid documentation and testing. A complete and nice looking documentation is key to a successful development and code maintainability. Please feel free to open any issues you might come up with and to submit your own PRs. There is not a contributing guide yet

Contributors

Thanks goes to these wonderful people (emoji key):


Olavo Parno

🤔 💻 ⚠️

nothingismagick

🤔 🐛 🖋

Dave Fisher

🐛

Martin Zagora

🤔 🐛

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

License

Jest Badges Readme is MIT licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].