Skip to content

Commit bbc15c9

Browse files
committed
Add test coverage support with c8
- Add test:coverage script to package.json - Install c8 for ES module coverage reporting - Add .c8rc.json configuration file - Coverage reports generated in coverage/ directory (text, HTML, LCOV)
1 parent 7733316 commit bbc15c9

3 files changed

Lines changed: 241 additions & 5 deletions

File tree

.c8rc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"exclude": [
3+
"test/**",
4+
"**/*.test.mjs",
5+
"**/*.spec.mjs",
6+
"config/**",
7+
"node_modules/**",
8+
"coverage/**",
9+
"**/tools/**",
10+
"**/*.example"
11+
],
12+
"reporter": ["text", "html", "lcov"],
13+
"check-coverage": false,
14+
"lines": 0,
15+
"functions": 0,
16+
"branches": 0,
17+
"statements": 0
18+
}
19+

package-lock.json

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

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"pretest": "if [ ! -f 'config/config.json' ]; then cp 'config/config.json.example' 'config/config.json'; fi",
88
"test": "NODE_ENV=test mocha --reporter spec 'test/**/*.mjs' --ignore 'test/tools/**' --exit",
9+
"test:coverage": "NODE_ENV=test c8 --reporter=text --reporter=html --reporter=lcov mocha --reporter spec 'test/**/*.mjs' --ignore 'test/tools/**' --exit",
910
"test:record": "node test/tools/record-spotify-responses.mjs",
1011
"test:integration": "node test/tools/integration-test-suite.mjs",
1112
"test:integration:verbose": "node test/tools/integration-test-suite.mjs --verbose"
@@ -25,6 +26,7 @@
2526
"url": "git@github.com:htilly/SlackONOS.git"
2627
},
2728
"devDependencies": {
29+
"c8": "^10.1.3",
2830
"chai": "6.2.1",
2931
"mocha": "^11.7.5",
3032
"sinon": "^21.0.0"
@@ -34,17 +36,17 @@
3436
"dependencies": {
3537
"@jsfeb26/urllib-sync": "^1.1.4",
3638
"@sefinek/google-tts-api": "^2.1.11",
39+
"@simplewebauthn/server": "^13.2.2",
3740
"@slack/rtm-api": "^7.0.4",
3841
"@slack/socket-mode": "^2.0.5",
3942
"@slack/web-api": "^7.12.0",
40-
"@simplewebauthn/server": "^13.2.2",
4143
"bcrypt": "^6.0.0",
4244
"discord.js": "^14.17.3",
43-
"selfsigned": "^5.2.0",
4445
"mp3-duration": "^1.1.0",
4546
"nconf": "^0.13.0",
4647
"openai": "^6.9.1",
4748
"posthog-node": "^5.15.0",
49+
"selfsigned": "^5.2.0",
4850
"sonos": "^1.14.2",
4951
"soundcraft-ui-connection": "^4.0.0",
5052
"urlencode": "^2.0.0",

0 commit comments

Comments
 (0)