test: enable lcov reporter on ci

configure typescript coverage
This commit is contained in:
Jonas Gloning 2023-01-07 20:08:39 +01:00
parent e1fd4dc476
commit e45a9afc86
No known key found for this signature in database
GPG Key ID: 684639B5E59E7614
7 changed files with 48 additions and 7 deletions

View File

@ -29,7 +29,7 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm run coverage
- run: npm run coverage:lcov
- name: Publish code coverage to CodeClimate
uses: paambaati/codeclimate-action@v3.2.0
env:

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.nyc_output
coverage
*.seed
*.log
*.csv

5
.mocharc.jsonc Normal file
View File

@ -0,0 +1,5 @@
{
"$schema": "https://json.schemastore.org/mocharc",
"require": "source-map-support/register",
"require": "ts-node/register"
}

6
.nycrc Normal file
View File

@ -0,0 +1,6 @@
{
"$schema": "https://json.schemastore.org/nycrc.json",
"extends": "@istanbuljs/nyc-config-typescript",
"all": true,
"include": ["src/**/*.ts"]
}

28
package-lock.json generated
View File

@ -18,6 +18,7 @@
"peerjs": "bin/peerjs"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/chai": "^4.2.11",
@ -38,7 +39,8 @@
"rimraf": "^3.0.2",
"semantic-release": "^19.0.5",
"sinon": "^7.5.0",
"ts-node": "^8.7.0",
"source-map-support": "^0.5.21",
"ts-node": "^8.10.2",
"typescript": "^4.1.2"
},
"engines": {
@ -499,6 +501,21 @@
"node": ">=8"
}
},
"node_modules/@istanbuljs/nyc-config-typescript": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.2.tgz",
"integrity": "sha512-iKGIyMoyJuFnJRSVTZ78POIRvNnwZaWIf8vG4ZS3rQq58MMDrqEX2nnzx0R28V2X8JvmKYiqY9FP2hlJsm8A0w==",
"dev": true,
"dependencies": {
"@istanbuljs/schema": "^0.1.2"
},
"engines": {
"node": ">=8"
},
"peerDependencies": {
"nyc": ">=15"
}
},
"node_modules/@istanbuljs/schema": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",
@ -11493,6 +11510,15 @@
}
}
},
"@istanbuljs/nyc-config-typescript": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.2.tgz",
"integrity": "sha512-iKGIyMoyJuFnJRSVTZ78POIRvNnwZaWIf8vG4ZS3rQq58MMDrqEX2nnzx0R28V2X8JvmKYiqY9FP2hlJsm8A0w==",
"dev": true,
"requires": {
"@istanbuljs/schema": "^0.1.2"
}
},
"@istanbuljs/schema": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",

View File

@ -33,8 +33,9 @@
"lint": "eslint --ext .js,.ts .",
"tsc": "tsc",
"prebuild": "npm run lint",
"test": "npm run lint && mocha -r ts-node/register \"test/**/*\"",
"coverage": "nyc mocha -r ts-node/register \"test/**/*\"",
"test": "npm run lint && mocha \"test/**/*\"",
"coverage": "nyc mocha \"test/**/*\"",
"coverage:lcov": "nyc --reporter=lcov mocha \"test/**/*\"",
"start": "bin/peerjs --port ${PORT:=9000}",
"dev:start": "npm-run-all build start",
"dev": "nodemon --watch src -e ts --exec npm run dev:start",
@ -47,6 +48,7 @@
"yargs": "^15.3.1"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/chai": "^4.2.11",
@ -67,7 +69,8 @@
"rimraf": "^3.0.2",
"semantic-release": "^19.0.5",
"sinon": "^7.5.0",
"ts-node": "^8.7.0",
"source-map-support": "^0.5.21",
"ts-node": "^8.10.2",
"typescript": "^4.1.2"
},
"engines": {

View File

@ -14,7 +14,7 @@
"noUnusedParameters": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": false,
"sourceMap": true,
"outDir": "dist"
},
"include": [
@ -24,4 +24,4 @@
"test",
"bin",
]
}
}