Skip to content

Commit bdb861a

Browse files
committed
use istanbul cli (nyc) to run unit tests
1 parent 8c0fcf8 commit bdb861a

File tree

6 files changed

+172
-15
lines changed

6 files changed

+172
-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

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ before_install:
1414
before_script:
1515
- greenkeeper-lockfile-update
1616
script:
17-
- node_modules/karma/bin/karma start karma.conf.js --single-run
17+
- yarn run test
1818
after_script:
1919
- greenkeeper-lockfile-upload
2020
after_success:

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": "prettier --config .prettierrc --write {src,test}/**/*.ts",
1111
"tslint-check": "tslint-config-prettier-check ./tslint.json",
1212
"clean-up": "rm -rf coverage && rm -rf lib",
1313
"prepublish": "tsc -d && publish-please guard",
1414
"publish-please": "npm run autoformat && npm run clean-up && publish-please"
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": "git@github.com:RobotlegsJS/RobotlegsJS-SignalCommandMap.git"
@@ -69,13 +89,15 @@
6989
"karma-sourcemap-writer": "^0.1.2",
7090
"karma-webpack": "^2.0.4",
7191
"mocha": "^3.5.3",
92+
"nyc": "^11.2.1",
7293
"prettier": "^1.7.0",
7394
"publish-please": "^2.3.1",
7495
"reflect-metadata": "^0.1.10",
7596
"remap-istanbul": "^0.9.5",
7697
"rimraf": "^2.6.2",
7798
"sinon": "^3.2.1",
7899
"sinon-chai": "^2.13.0",
100+
"source-map-support": "^0.4.18",
79101
"ts-loader": "^2.3.7",
80102
"ts-node": "^3.3.0",
81103
"tslint": "^5.7.0",

test/mocha.opts

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

0 commit comments

Comments
 (0)