1.0.1 • Published 5 years ago

s3-badges v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

s3-badges

Custom coverage badge generation and aws-s3 publishing

Currently suported: 1. Istanbul coverage report 2. Upload to s3 bucket (static web mode)

Configure your project

Install the package

npm install s3-badges nyc istanbul

Configure your project with necesary info for badge generation. You have an .s3-badgesrc.example you should paste in project's root folder with some options to configure.

.s3-badgesrc with minimal options (JSON format)

{
  "projectName": "dms",
  "awsAccessKeyId": "Your access key",
  "awsSecretAccessKey": "Your secret key"
}

Configure your package.json file to enable coverage report generation Add this line. Assuming you already have good working test command.

...
"test:coverage": "nyc --reporter=json-summary test",
...

Usage

npm run test:coverage

npx update-badges

istanbul-coverage {69.17%,orange}
Successfully uploaded package.
https://s3-<ZONE>.amazonaws.com/<BUCKET>/<PROJECT_NAME>-coverage.svg created

Now you can paste reported badge's link in your README.md file.