From 15807a6846cadafd9970910378738db8c3024edf Mon Sep 17 00:00:00 2001 From: Marcel Schlitzer Date: Wed, 19 Jul 2017 12:02:10 +0200 Subject: [PATCH] Set up code coverage with nyc --- .gitignore | 3 +++ .nycrc | 16 ++++++++++++++++ package.json | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 .nycrc diff --git a/.gitignore b/.gitignore index 4ce55e0..4a0938a 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,6 @@ jspm_packages # Optional REPL history .node_repl_history + +# Coverage report +coverage diff --git a/.nycrc b/.nycrc new file mode 100644 index 0000000..73780d2 --- /dev/null +++ b/.nycrc @@ -0,0 +1,16 @@ +{ + "include": [ + "src/**/*.ts", + "out/src/**/*.js" + ], + "exclude": [ + "test/index.ts", + "test/**/*.test.ts" + ], + "reporter": [ + "text-summary", + "html" + ], + "cache": true, + "sourceMap": true +} diff --git a/package.json b/package.json index c2288f4..66c695b 100644 --- a/package.json +++ b/package.json @@ -475,6 +475,8 @@ "watch": "tsc -watch -p ./", "test": "npm run compile && mocha", "lint": "tslint src/*.ts test/*.ts", + "coverage": "nyc mocha", + "report": "nyc report", "postinstall": "node ./node_modules/vscode/bin/install" }, "dependencies": {