Skip to content

Commit 468e68f

Browse files
Code Coverage (#249)
* Add codecoverage * On Travis executing with c8 is fine standalone * need to pretest when running cover standalone * Only include user facing commands in package json directly
1 parent 859a8dd commit 468e68f

File tree

4 files changed

+403
-11
lines changed

4 files changed

+403
-11
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ package-lock.json
33
.vscode/*
44
.DS_Store
55
dist/
6-
transpile/
6+
transpile/
7+
coverage/*

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ node_js:
55
- "lts/*"
66
before_install:
77
- unset _JAVA_OPTIONS # JVM heap sizes break closure compiler. #11203.
8-
script: yarn test
8+
script:
9+
- yarn pretest
10+
- yarn c8 ava
11+
- yarn c8 report --reporter=lcovonly
12+
- yarn codecov
913
branches:
1014
only:
1115
- master

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
"scripts": {
2323
"pretest": "rimraf dist transpile && tsc -p tsconfig.test.json & wait",
2424
"test": "ava",
25+
"precoverage": "c8 ava",
26+
"coverage": "c8 report --reporter=html",
27+
"postcoverage": "sirv coverage/",
2528
"build": "rimraf dist transpile && tsc -p tsconfig.json & wait",
26-
"postbuild": "rollup --config rollup.config.js",
29+
"postbuild": "rollup -c",
2730
"lint": "tslint -c tslint.json -p tsconfig.json",
2831
"release": "np",
2932
"prepublishOnly": "npm-run-all build"
@@ -46,6 +49,8 @@
4649
"@types/temp-write": "3.3.0",
4750
"ava": "2.4.0",
4851
"builtins": "2.0.1",
52+
"c8": "6.0.1",
53+
"codecov": "3.6.1",
4954
"husky": "3.1.0",
5055
"lint-staged": "9.5.0",
5156
"np": "5.2.1",
@@ -54,6 +59,7 @@
5459
"rimraf": "3.0.0",
5560
"rollup": "0.67.4",
5661
"rollup-plugin-copy": "3.1.0",
62+
"sirv-cli": "0.4.5",
5763
"tslint": "5.20.1",
5864
"typescript": "3.7.3"
5965
},

0 commit comments

Comments
 (0)