Skip to content

Commit 4deb7d4

Browse files
authored
Merge pull request #55 from MichielDeMey/feature/coveralls
Feat/coveralls Adds code coverage with Coveralls integration
2 parents 1f55fa2 + a7f73ec commit 4deb7d4

File tree

5 files changed

+406
-16
lines changed

5 files changed

+406
-16
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ npm-debug.log*
77
yarn-debug.log*
88
yarn-error.log*
99

10+
# Coverage files
11+
.nyc_output
12+
1013
# Editor directories and files
1114
.idea
1215
.vscode

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ script:
1515
- yarn lint
1616
- yarn test
1717

18-
after_script:
19-
- npm run coveralls
20-
2118
jobs:
2219
include:
20+
- stage: coverage
21+
node_js: lts/*
22+
script:
23+
- yarn coverage
24+
- yarn coveralls
2325
# Define the release stage that runs semantic-release
2426
- stage: release
2527
node_js: lts/*

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
/* istanbul ignore file */
12
module.exports = {extends: ['@commitlint/config-conventional']};

package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"lint": "tslint --project tsconfig.json -c tslint.json 'src/**/*.ts'",
1515
"test": "yarn lint && tsc && ts-mocha --paths 'src/**/test_*.ts' --exit",
1616
"test:watch": "yarn lint && ts-mocha --paths 'src/**/test_*.ts' -w --watch-extensions ts",
17-
"coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
17+
"coverage": "nyc --reporter=text npm run test",
18+
"coveralls": "nyc report --reporter=text-lcov | coveralls",
1819
"precommit": "yarn lint",
1920
"semantic-release": "semantic-release",
2021
"prettier": "prettier --config package.json src/**/*.ts",
@@ -27,14 +28,15 @@
2728
"cron-parser": "^2.7.3",
2829
"get-port": "^5.0.0",
2930
"ioredis": "^4.3.0",
30-
"node-uuid": "^1.4.8",
3131
"lodash": "^4.17.11",
32+
"node-uuid": "^1.4.8",
3233
"semver": "^6.3.0",
3334
"uuid": "^3.3.3"
3435
},
3536
"devDependencies": {
3637
"@commitlint/cli": "^8.1.0",
3738
"@commitlint/config-conventional": "^8.1.0",
39+
"@istanbuljs/nyc-config-typescript": "^0.1.3",
3840
"@semantic-release/changelog": "^3.0.4",
3941
"@semantic-release/commit-analyzer": "^6.3.0",
4042
"@semantic-release/git": "^7.0.16",
@@ -51,24 +53,31 @@
5153
"@types/uuid": "^3.4.5",
5254
"chai": "^4.2.0",
5355
"copyfiles": "^2.1.1",
54-
"coveralls": "^3.0.2",
56+
"coveralls": "^3.0.7",
5557
"delay": "^4.3.0",
5658
"husky": "^3.0.3",
5759
"istanbul": "^0.4.5",
5860
"mocha": "^6.1.4",
5961
"mocha-lcov-reporter": "^1.3.0",
62+
"nyc": "^14.1.1",
6063
"p-reflect": "^2.1.0",
6164
"prettier": "^1.18.2",
6265
"semantic-release": "^15.13.2",
6366
"sinon": "^7.2.2",
6467
"ts-mocha": "^6.0.0",
68+
"ts-node": "^8.4.1",
6569
"tslint": "^5.12.0",
6670
"tslint-config-prettier": "^1.18.0",
6771
"tslint-eslint-rules": "^5.4.0",
6872
"tslint-plugin-prettier": "^2.0.1",
6973
"typedoc": "^0.15.0",
7074
"typescript": "^3.2.2"
7175
},
76+
"nyc": {
77+
"extends": "@istanbuljs/nyc-config-typescript",
78+
"all": true,
79+
"check-coverage": true
80+
},
7281
"config": {
7382
"commitizen": {
7483
"path": "node_modules/cz-conventional-changelog"

0 commit comments

Comments
 (0)