Skip to content

Commit fda5563

Browse files
committed
use istanbul cli (nyc) to run unit tests
1 parent 90835f2 commit fda5563

File tree

5 files changed

+171
-15
lines changed

5 files changed

+171
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea
2+
.nyc_output
23
build
34
lib
45
node_modules

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.idea
2+
/.nyc_output
23
/.vscode
34
/coverage
45
/dist

package.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,34 @@
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
77
"scripts": {
8-
"test": "karma start --single-run",
9-
"mocha": "mocha test/**/*.test.ts --require ts-node/register",
8+
"test": "nyc mocha",
9+
"karma": "karma start --single-run",
1010
"autoformat": "tsfmt -r --useTsconfig tsconfig.test.json",
1111
"prepublish": "tsc -d && publish-please guard",
1212
"clean-up": "rm -rf coverage && rm -rf lib",
1313
"publish-please": "npm run autoformat && npm run clean-up && npm run build && publish-please",
1414
"build": "webpack --env.production"
1515
},
16+
"nyc": {
17+
"include": [
18+
"src/**/*.ts"
19+
],
20+
"exclude": [
21+
"test"
22+
],
23+
"extension": [
24+
".ts"
25+
],
26+
"require": [
27+
"ts-node/register"
28+
],
29+
"reporter": [
30+
"text-summary",
31+
"lcov"
32+
],
33+
"sourceMap": true,
34+
"instrument": true
35+
},
1636
"repository": {
1737
"type": "git",
1838
"url": "[email protected]:RobotlegsJS/SignalsJS.git"
@@ -64,12 +84,14 @@
6484
"karma-sourcemap-writer": "^0.1.2",
6585
"karma-webpack": "^2.0.4",
6686
"mocha": "^3.5.0",
87+
"nyc": "^11.1.0",
6788
"publish-please": "^2.3.1",
6889
"reflect-metadata": "^0.1.10",
6990
"remap-istanbul": "^0.9.5",
7091
"rimraf": "^2.6.1",
7192
"sinon": "^3.2.1",
7293
"sinon-chai": "^2.13.0",
94+
"source-map-support": "^0.4.17",
7395
"ts-loader": "^2.3.4",
7496
"ts-node": "^3.3.0",
7597
"tslint": "^5.7.0",

test/mocha.opts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--compilers ts-node/register
2+
--require source-map-support/register
3+
--full-trace
4+
--bail
5+
test/**/*.test.ts

0 commit comments

Comments
 (0)