s3-badges
v1.0.1
Published
Custom badges generation and publishing on aws s3 bucket
Downloads
3
Readme
s3-badges
Custom coverage badge generation and aws-s3 publishing
Currently suported:
- Istanbul coverage report
- 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.