Skip to content

Commit

Permalink
fix code coverage badges
Browse files Browse the repository at this point in the history
  • Loading branch information
nitram509 committed Nov 21, 2020
1 parent 652082d commit 0a03611
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 10 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ language: node_js
node_js:
- "stable"
- "14"
- "12"
- "11"
8 changes: 7 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ module.exports = function (grunt) {
args: [
'jest'
]
},
badges: {
cmd: 'npx',
args: [
'jest-coverage-badges'
]
}
}

Expand All @@ -76,6 +82,6 @@ module.exports = function (grunt) {
// Default task(s).
grunt.registerTask('default', ['ts:main', 'copy']);
grunt.registerTask('test', ['ts:test', 'run:jest']);
grunt.registerTask('package', ['clean', 'ts:main', 'ts:test', 'run:jest', 'copy']);
grunt.registerTask('package', ['clean', 'ts:main', 'ts:test', 'run:jest', 'run:badges', 'copy']);

};
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ Build Status
--------------------

[![Build Status](https://travis-ci.org/nitram509/jmacaroons.svg?branch=master)](https://travis-ci.org/nitram509/macaroons.js)
[![devDependency Status](https://david-dm.org/nitram509/macaroons.js.png)](https://david-dm.org/nitram509/macaroons.js)
[![devDependency Status](https://david-dm.org/nitram509/macaroons.js/dev-status.png)](https://david-dm.org/nitram509/macaroons.js#info=devDependencies)
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)

[![NPM](https://nodei.co/npm/macaroons.js.png)](https://nodei.co/npm/macaroons.js/)

Code Coverage
--------------------

| Statements | Branches | Functions | Lines |
| ------------------------- | ----------------------- | ------------------------ | -------------------- |
| ![Statements](./coverage/badge-statements.svg) | ![Branches](./coverage/badge-branches.svg) | ![Functions](./coverage/badge-functions.svg) | ![Lines](./coverage/badge-lines.svg) |


Community & Badges
--------------------

Expand Down
1 change: 1 addition & 0 deletions coverage/badge-branches.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions coverage/badge-functions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions coverage/badge-lines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions coverage/badge-statements.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions coverage/coverage-summary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{"total": {"lines":{"total":715,"covered":627,"skipped":0,"pct":87.69},"statements":{"total":715,"covered":627,"skipped":0,"pct":87.69},"functions":{"total":37,"covered":32,"skipped":0,"pct":86.49},"branches":{"total":85,"covered":79,"skipped":0,"pct":92.94}}
,"/Users/maki/projects/macaroons.js/src/main/ts/Base64Tools.ts": {"lines":{"total":15,"covered":15,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":15,"covered":15,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/maki/projects/macaroons.js/src/main/ts/BufferTools.ts": {"lines":{"total":23,"covered":20,"skipped":0,"pct":86.96},"functions":{"total":2,"covered":1,"skipped":0,"pct":50},"statements":{"total":23,"covered":20,"skipped":0,"pct":86.96},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}}
,"/Users/maki/projects/macaroons.js/src/main/ts/CaveatPacket.ts": {"lines":{"total":31,"covered":31,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":31,"covered":31,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}}
,"/Users/maki/projects/macaroons.js/src/main/ts/CaveatPacketType.ts": {"lines":{"total":12,"covered":12,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":12,"covered":12,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/maki/projects/macaroons.js/src/main/ts/CryptoTools.ts": {"lines":{"total":90,"covered":71,"skipped":0,"pct":78.89},"functions":{"total":8,"covered":7,"skipped":0,"pct":87.5},"statements":{"total":90,"covered":71,"skipped":0,"pct":78.89},"branches":{"total":11,"covered":10,"skipped":0,"pct":90.91}}
,"/Users/maki/projects/macaroons.js/src/main/ts/Macaroon.ts": {"lines":{"total":39,"covered":39,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":39,"covered":39,"skipped":0,"pct":100},"branches":{"total":1,"covered":1,"skipped":0,"pct":100}}
,"/Users/maki/projects/macaroons.js/src/main/ts/MacaroonsBuilder.ts": {"lines":{"total":72,"covered":70,"skipped":0,"pct":97.22},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":72,"covered":70,"skipped":0,"pct":97.22},"branches":{"total":7,"covered":6,"skipped":0,"pct":85.71}}
,"/Users/maki/projects/macaroons.js/src/main/ts/MacaroonsConstants.ts": {"lines":{"total":39,"covered":18,"skipped":0,"pct":46.15},"functions":{"total":1,"covered":0,"skipped":0,"pct":0},"statements":{"total":39,"covered":18,"skipped":0,"pct":46.15},"branches":{"total":1,"covered":1,"skipped":0,"pct":100}}
,"/Users/maki/projects/macaroons.js/src/main/ts/MacaroonsDeSerializer.ts": {"lines":{"total":144,"covered":125,"skipped":0,"pct":86.81},"functions":{"total":11,"covered":10,"skipped":0,"pct":90.91},"statements":{"total":144,"covered":125,"skipped":0,"pct":86.81},"branches":{"total":36,"covered":34,"skipped":0,"pct":94.44}}
,"/Users/maki/projects/macaroons.js/src/main/ts/MacaroonsSerializer.ts": {"lines":{"total":64,"covered":53,"skipped":0,"pct":82.81},"functions":{"total":4,"covered":3,"skipped":0,"pct":75},"statements":{"total":64,"covered":53,"skipped":0,"pct":82.81},"branches":{"total":5,"covered":5,"skipped":0,"pct":100}}
,"/Users/maki/projects/macaroons.js/src/main/ts/MacaroonsVerifier.ts": {"lines":{"total":163,"covered":150,"skipped":0,"pct":92.02},"functions":{"total":8,"covered":8,"skipped":0,"pct":100},"statements":{"total":163,"covered":150,"skipped":0,"pct":92.02},"branches":{"total":20,"covered":18,"skipped":0,"pct":90}}
,"/Users/maki/projects/macaroons.js/src/main/ts/ThirdPartyPacket.ts": {"lines":{"total":10,"covered":10,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":10,"covered":10,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
,"/Users/maki/projects/macaroons.js/src/main/ts/verifier/TimestampCaveatVerifier.ts": {"lines":{"total":13,"covered":13,"skipped":0,"pct":100},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":13,"covered":13,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
}
11 changes: 6 additions & 5 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ export default {
coverageProvider: "v8",

// A list of reporter names that Jest uses when writing coverage reports
// coverageReporters: [
// "json",
// "text",
// "lcov",
coverageReporters: [
"json",
"json-summary",
"text",
"lcov",
// "clover"
// ],
],

// An object that configures minimum threshold enforcement for coverage results
// coverageThreshold: undefined,
Expand Down
26 changes: 26 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"grunt-run": "^0.8.1",
"grunt-ts": "^6.0.0-beta.22",
"typescript": "^4.1.2",
"ts-node": "^9.0.0"
"ts-node": "^9.0.0",
"jest-coverage-badges": "^1.1.2"
},
"directories": {
"lib": "./lib"
Expand Down

0 comments on commit 0a03611

Please sign in to comment.