From 1d5afb9f28fbc24b71d261170220b7fa020e4710 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Thu, 5 Aug 2021 15:38:03 +0200 Subject: [PATCH] Replace `nyc` with `c8` --- .gitignore | 5 ++--- index.js | 6 ++++-- package.json | 12 +++--------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index fdefc8c..33d4929 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ -.DS_Store -*.log -.nyc_output/ coverage/ node_modules/ +.DS_Store +*.log yarn.lock diff --git a/index.js b/index.js index 0063bf5..16f98de 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,8 @@ module.exports = directive function directive() { var data = this.data() - /* istanbul ignore next - old remark. */ + // Old remark. + /* c8 ignore next 14 */ if ( !warningIssued && ((this.Parser && @@ -32,7 +33,8 @@ function directive() { add('toMarkdownExtensions', toMarkdown) function add(field, value) { - /* istanbul ignore if - other extensions. */ + // Other extensions. + /* c8 ignore next */ if (data[field]) data[field].push(value) else data[field] = [value] } diff --git a/package.json b/package.json index 4d2d2ce..02b74fa 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,10 @@ "micromark-extension-directive": "^1.0.0" }, "devDependencies": { + "c8": "^7.0.0", "dtslint": "^4.0.0", "is-hidden": "^1.0.0", "not": "^0.1.0", - "nyc": "^15.0.0", "prettier": "^2.0.0", "remark": "^13.0.0", "remark-cli": "^9.0.0", @@ -49,17 +49,11 @@ }, "scripts": { "format": "remark . -qfo --ignore-pattern test/ && prettier . -w --loglevel warn && xo --fix", - "test-api": "node test", - "test-coverage": "nyc --reporter lcov tape test/index.js", + "test-api": "node --conditions development test/index.js", + "test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api", "test-types": "dtslint types", "test": "npm run format && npm run test-coverage && npm run test-types" }, - "nyc": { - "check-coverage": true, - "lines": 100, - "functions": 100, - "branches": 100 - }, "prettier": { "tabWidth": 2, "useTabs": false,