From a3e622ba0dbf03dc6ac3886ecda20a4c8ede7e5d Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Tue, 27 Dec 2016 19:39:13 -0800 Subject: [PATCH] chore: set up test coverage (#638) Use nyc for test coverage and ignore all nyc-related files in git & eslint. This increases testing time (~35sec -> ~60sec on my 4-core machine). --- .eslintignore | 8 ++++---- .gitignore | 2 ++ package.json | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.eslintignore b/.eslintignore index e9c04ea..65dfd0f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,6 @@ -ava-test/resources/ -ava-test/tmp/ +.nyc_output/ +coverage/ +make.js +node_modules/ test/resources/ test/tmp/ -node_modules/ -make.js diff --git a/.gitignore b/.gitignore index 77f3ac7..28d0f3b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ npm-debug.log* node_modules tmp +coverage/ +.nyc_output/ # Linux *~ diff --git a/package.json b/package.json index 3ff1aa1..2229b19 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ ], "scripts": { "posttest": "npm run lint", - "test": "ava --serial test/*.js", + "test": "nyc --reporter=text --reporter=lcov ava --serial test/*.js", "gendocs": "node scripts/generate-docs", "lint": "eslint .", "after-travis": "travis-check-changes", @@ -57,6 +57,7 @@ "eslint": "^2.0.0", "eslint-config-airbnb-base": "^3.0.0", "eslint-plugin-import": "^1.11.1", + "nyc": "^10.0.0", "shelljs-changelog": "^0.2.0", "shelljs-release": "^0.2.0", "shx": "^0.2.0",