Skip to content

Commit 81241b8

Browse files
authored
Merge pull request #228 from golopot/coverage
build: add coverage in `npm test`
2 parents c47ede3 + f9e09a5 commit 81241b8

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.babelrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@
1212
}
1313
}
1414
]
15-
]
15+
],
16+
"env": {
17+
"test": {
18+
"plugins": [ "istanbul" ]
19+
}
20+
}
1621
}

package.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@babel/preset-env": "^7.3.1",
1919
"@babel/register": "^7.0.0",
2020
"babel-plugin-add-module-exports": "^1.0.0",
21+
"babel-plugin-istanbul": "^5.1.4",
2122
"chai": "^4.2.0",
2223
"eslint": "^5.14.1",
2324
"eslint-config-canonical": "^16.1.0",
@@ -27,6 +28,7 @@
2728
"husky": "^1.3.1",
2829
"marked": "^0.6.1",
2930
"mocha": "^6.0.1",
31+
"nyc": "^14.1.1",
3032
"semantic-release": "^15.13.3"
3133
},
3234
"engines": {
@@ -58,7 +60,17 @@
5860
"build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps",
5961
"create-readme": "gitdown ./.README/README.md --output-file ./README.md && npm run add-assertions",
6062
"lint": "eslint ./src ./test",
61-
"test": "mocha --recursive --require @babel/register --reporter progress"
63+
"test": "BABEL_ENV=test nyc --reporter text-summary mocha --recursive --require @babel/register --reporter progress"
64+
},
65+
"nyc": {
66+
"require": [
67+
"@babel/register"
68+
],
69+
"sourceMap": false,
70+
"instrument": false,
71+
"include": [
72+
"src/"
73+
]
6274
},
6375
"version": "1.0.0"
6476
}

0 commit comments

Comments
 (0)