From df26f14b0b854d82b0d3ca7b4949811c9f151357 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 4 Dec 2020 14:07:41 -0800 Subject: [PATCH] [Tests] run `nyc` on all tests --- .eslintignore | 1 + .gitignore | 5 +++++ .nycrc | 13 +++++++++++++ package.json | 5 ++--- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 .eslintignore create mode 100644 .nycrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..404abb2 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +coverage/ diff --git a/.gitignore b/.gitignore index 71e9a52..e1eb5ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +# gitignore + lib-cov *.seed *.log @@ -18,3 +20,6 @@ node_modules npm-shrinkwrap.json package-lock.json yarn.lock + +coverage/ +.nyc_output/ diff --git a/.nycrc b/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/package.json b/package.json index 66719a4..bc6bce8 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,8 @@ "prepublish": "safe-publish-latest", "pretest": "npm run lint", "test": "npm run tests-only", - "tests-only": "node test", + "tests-only": "nyc tape 'test/**/*.js'", "posttest": "npx aud --production", - "coverage": "covert test", "lint": "eslint .", "version": "auto-changelog && git add CHANGELOG.md", "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" @@ -42,8 +41,8 @@ "@ljharb/eslint-config": "^17.1.0", "aud": "^1.1.2", "auto-changelog": "^2.2.0", - "covert": "^1.1.1", "eslint": "^7.6.0", + "nyc": "^10.3.2", "safe-publish-latest": "^1.1.4", "tape": "^5.0.1" },