📜  jest-badges-readme - Javascript (1)

📅  最后修改于: 2023-12-03 14:43:06.185000             🧑  作者: Mango

Jest Badges Readme - Javascript

If you're using Jest for testing your Javascript code, then jest-badges-readme is a useful package for generating badges for your README file to keep track of your test results.

Getting Started

To use jest-badges-readme, you first need to install it as a dev dependency:

npm install jest-badges-readme --save-dev
Generating Badges

Once jest-badges-readme has been installed, you can generate badges by running the following command:

jest-badges-readme

This will generate an output in markdown format that can be copied into your README file.

## Test Results

[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)
[![Coverage Status](https://coveralls.io/repos/github/{username}/{repo}/badge.svg?branch=master)](https://coveralls.io/github/{username}/{repo}?branch=master)
[![Build Status](https://travis-ci.org/{username}/{repo}.svg?branch=master)](https://travis-ci.org/{username}/{repo})

These badges provide information on the following:

  • The framework used for testing (Jest)
  • Test coverage information (using Coveralls)
  • The status of test runs (using Travis CI)
Customizing Badges

If you want to customize the output, you can use the following command:

jest-badges-readme <options>

The following options are available:

  • --test-framework - choose a different test framework (default is Jest)
  • --coverage-service - choose a different coverage service (default is Coveralls)
  • --username - your username (required for the Coveralls badge)
  • --repo - your repository name (required for the Coveralls and Travis CI badges)
Conclusion

Adding badges to your README file using jest-badges-readme can help keep track of your test results and improve the credibility of your project.