From 703a7cd3c20c2c8be4ef744471a1a3eef8fa2d6b Mon Sep 17 00:00:00 2001 From: stoically Date: Wed, 18 Dec 2019 09:24:05 +0100 Subject: [PATCH] Add test coverage with nyc --- .eslintignore | 1 + .gitignore | 4 ++++ package.json | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index 9f1953c..3a5b5a0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ lib/testpilot/*.js +coverage \ No newline at end of file diff --git a/.gitignore b/.gitignore index c745683..ff6bfab 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ src/web-ext-artifacts/* # JetBrains IDE files .idea + +# IstanbulJS +.nyc_output +coverage \ No newline at end of file diff --git a/package.json b/package.json index bf05207..753f292 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "json": "^9.0.6", "mocha": "^6.2.2", "npm-run-all": "^4.0.0", + "nyc": "^14.1.1", "sinon": "^7.5.0", "sinon-chai": "^3.3.0", "stylelint": "^7.9.0", @@ -42,7 +43,8 @@ "lint:html": "htmllint *.html", "lint:js": "eslint .", "package": "rm -rf src/web-ext-artifacts && npm run build && mv src/web-ext-artifacts/firefox_multi-account_containers-*.zip addon.xpi", - "test": "npm run lint && mocha ./test/setup.js test/**/*.test.js", - "test-watch": "mocha ./test/setup.js test/**/*.test.js --watch" + "test": "npm run lint && npm run coverage", + "test-watch": "mocha ./test/setup.js test/**/*.test.js --watch", + "coverage": "nyc --reporter=html --reporter=text mocha ./test/setup.js test/**/*.test.js --timeout 60000" } }