Skip to content

Commit 0a03611

Browse files
committed
fix code coverage badges
1 parent 652082d commit 0a03611

11 files changed

+68
-10
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ language: node_js
33
node_js:
44
- "stable"
55
- "14"
6-
- "12"
76
- "11"

Gruntfile.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ module.exports = function (grunt) {
6161
args: [
6262
'jest'
6363
]
64+
},
65+
badges: {
66+
cmd: 'npx',
67+
args: [
68+
'jest-coverage-badges'
69+
]
6470
}
6571
}
6672

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

8187
};

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@ Build Status
2626
--------------------
2727

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

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

33+
Code Coverage
34+
--------------------
35+
36+
| Statements | Branches | Functions | Lines |
37+
| ------------------------- | ----------------------- | ------------------------ | -------------------- |
38+
| ![Statements](./coverage/badge-statements.svg) | ![Branches](./coverage/badge-branches.svg) | ![Functions](./coverage/badge-functions.svg) | ![Lines](./coverage/badge-lines.svg) |
39+
40+
3541
Community & Badges
3642
--------------------
3743

coverage/badge-branches.svg

Lines changed: 1 addition & 0 deletions
Loading

coverage/badge-functions.svg

Lines changed: 1 addition & 0 deletions
Loading

coverage/badge-lines.svg

Lines changed: 1 addition & 0 deletions
Loading

coverage/badge-statements.svg

Lines changed: 1 addition & 0 deletions
Loading

coverage/coverage-summary.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{"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}}
2+
,"/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}}
3+
,"/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}}
4+
,"/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}}
5+
,"/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}}
6+
,"/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}}
7+
,"/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}}
8+
,"/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}}
9+
,"/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}}
10+
,"/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}}
11+
,"/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}}
12+
,"/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}}
13+
,"/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}}
14+
,"/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}}
15+
}

jest.config.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ export default {
3434
coverageProvider: "v8",
3535

3636
// A list of reporter names that Jest uses when writing coverage reports
37-
// coverageReporters: [
38-
// "json",
39-
// "text",
40-
// "lcov",
37+
coverageReporters: [
38+
"json",
39+
"json-summary",
40+
"text",
41+
"lcov",
4142
// "clover"
42-
// ],
43+
],
4344

4445
// An object that configures minimum threshold enforcement for coverage results
4546
// coverageThreshold: undefined,

package-lock.json

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
"grunt-run": "^0.8.1",
5454
"grunt-ts": "^6.0.0-beta.22",
5555
"typescript": "^4.1.2",
56-
"ts-node": "^9.0.0"
56+
"ts-node": "^9.0.0",
57+
"jest-coverage-badges": "^1.1.2"
5758
},
5859
"directories": {
5960
"lib": "./lib"

0 commit comments

Comments
 (0)