Skip to content

Commit 7d0fa15

Browse files
authored
Unify coverage and set thresholds (#508)
* irc2as: set thresholds * switch to c8 and set thresholds * set threshold for irc patform tests * run coverage after test * set coverage threshold params order
1 parent 2ddd731 commit 7d0fa15

File tree

10 files changed

+3459
-1395
lines changed

10 files changed

+3459
-1395
lines changed

packages/activity-streams.js/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"event-emitter": "^0.3.5"
88
},
99
"devDependencies": {
10-
"c8": "7.7.3",
10+
"c8": "^7.8.0",
1111
"chai": "4.3.4",
1212
"karma": "6.3.4",
1313
"karma-chai": "0.1.0",
@@ -27,9 +27,10 @@
2727
"test:node": "c8 -r text mocha ./lib/**/*.test.js",
2828
"test:node:lcov": "c8 -r lcov mocha ./lib/**/*.test.js",
2929
"test:browser": "karma start --single-run --browsers ChromeHeadless,FirefoxHeadless ./karma.config.js",
30+
"coverage": "c8 check-coverage --statements 90 --branches 85 --functions 85 --lines 90",
3031
"build": "webpack --mode production",
3132
"release": "yarn run build && yarn run test",
32-
"test": "yarn run test:node:lcov && yarn run test:browser"
33+
"test": "yarn run test:node:lcov && yarn run test:browser && yarn run coverage"
3334
},
3435
"keywords": [
3536
"activity",

packages/activity-streams.js/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,10 @@ [email protected]:
371371
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6"
372372
integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==
373373

374-
c8@7.7.3:
375-
version "7.7.3"
376-
resolved "https://registry.yarnpkg.com/c8/-/c8-7.7.3.tgz#5af8f83b55dace03b353375e7a2ba85e2c13b17f"
377-
integrity sha512-ZyA7n3w8i4ETV25tVYMHwJxCSnaOf/LfA8vOcuZOPbonuQfD7tBT/gMWZy7eczRpCDuHcvMXwoqAemg6R0p3+A==
374+
c8@^7.8.0:
375+
version "7.8.0"
376+
resolved "https://registry.yarnpkg.com/c8/-/c8-7.8.0.tgz#8fcfe848587d9d5796f22e9b0546a387a66d1b3b"
377+
integrity sha512-x2Bx+IIEd608B1LmjiNQ/kizRPkCWo5XzuV57J9afPjAHSnYXALwbCSOkQ7cSaNXBNblfqcvdycj+klmL+j6yA==
378378
dependencies:
379379
"@bcoe/v8-coverage" "^0.2.3"
380380
"@istanbuljs/schema" "^0.1.2"

packages/irc2as/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"jaribu": "2.2.3"
1616
},
1717
"scripts": {
18-
"test": "c8 jaribu"
18+
"test": "c8 jaribu && yarn run coverage",
19+
"coverage": "c8 check-coverage --statements 90 --branches 90 --functions 95 --lines 90"
1920
},
2021
"repository": {
2122
"type": "git",

packages/sockethub-platform-irc/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"tv4": "1.3.0"
3535
},
3636
"scripts": {
37-
"test": "c8 jaribu",
37+
"test": "c8 jaribu && yarn run coverage",
38+
"coverage": "c8 check-coverage --statements 80 --branches 55 --functions 85 --lines 80",
3839
"doc": "jsdoc2md --no-gfm --heading-depth 1 index.js > API.md",
3940
"lint": "eslint --ignore-pattern \"coverage\" \"**/*.js\"",
4041
"lint:fix": "eslint --ignore-pattern \"coverage\" --fix \"**/*.js\""

packages/sockethub-platform-xmpp/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,21 @@
2323
"homepage": "https://github.com/sockethub/sockethub/tree/master/packages/sockethub-platform-xmpp",
2424
"dependencies": {
2525
"@xmpp/client": "^0.12.0",
26+
"c8": "^7.8.0",
2627
"ltx": "^2.9.2"
2728
},
2829
"devDependencies": {
2930
"chai": "4.3.4",
3031
"jsdoc-to-markdown": "7.0.1",
3132
"mocha": "9.0.3",
32-
"nyc": "15.1.0",
3333
"proxyquire": "2.1.3",
3434
"sinon": "11.1.2",
3535
"sockethub-testing-mocks": "1.2.1",
3636
"tv4": "1.3.0"
3737
},
3838
"scripts": {
39-
"test": "nyc mocha **/*.test.js",
39+
"test": "c8 mocha **/*.test.js && yarn run coverage",
40+
"coverage": "c8 check-coverage --statements 85 --branches 80 --functions 70 --lines 85",
4041
"doc": "jsdoc2md --no-gfm --heading-depth 1 src/index.js > API.md"
4142
}
4243
}

0 commit comments

Comments
 (0)