From ab51422d8ab731c03c256a5fdef5d1402c4c4e0c Mon Sep 17 00:00:00 2001 From: Vitaly Puzrin Date: Tue, 19 May 2020 21:25:56 +0300 Subject: [PATCH] istanbul => nyc --- .gitignore | 1 + .travis.yml | 7 ++----- Makefile | 14 ++++---------- package.json | 7 +++++-- support/specsplit.js | 2 +- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index b02f491..c94e03b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.nyc_output benchmark/extra/ node_modules/ coverage/ diff --git a/.travis.yml b/.travis.yml index 9a7695c..95d0c5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,3 @@ language: node_js -node_js: - - '8' - - node -after_success: make report-coverage -sudo: false +node_js: node +after_success: npm run report-coveralls diff --git a/Makefile b/Makefile index 72bf625..8913110 100644 --- a/Makefile +++ b/Makefile @@ -38,19 +38,13 @@ gh-demo: demo rm -rf ./demo lint: - eslint . + npm run lint -test: lint - mocha - echo "CommonMark stat:\n" - ./support/specsplit.js test/fixtures/commonmark/spec.txt +test: + npm test coverage: - rm -rf coverage - istanbul cover node_modules/.bin/_mocha - -report-coverage: - -istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage + npm run coverage doc: rm -rf ./apidoc diff --git a/package.json b/package.json index fb8677e..43c2a10 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,10 @@ "markdown-it": "bin/markdown-it.js" }, "scripts": { - "test": "make test" + "lint": "eslint .", + "test": "npm run lint && nyc mocha && node support/specsplit.js test/fixtures/commonmark/spec.txt", + "coverage": "npm run test && nyc report --reporter html", + "report-coveralls": "nyc report --reporter=text-lcov | coveralls" }, "files": [ "index.js", @@ -41,7 +44,6 @@ "eslint": "^6.0.1", "express": "^4.14.0", "highlight.js": "^9.2.0", - "istanbul": "^0.4.5", "markdown-it-abbr": "^1.0.4", "markdown-it-container": "^2.0.0", "markdown-it-deflist": "^2.0.0", @@ -55,6 +57,7 @@ "markdown-it-testgen": "^0.1.3", "mocha": "^6.1.4", "ndoc": "^5.0.0", + "nyc": "^15.0.1", "pug-cli": "^1.0.0-alpha6", "stylus": "^0.54.5", "supertest": "^4.0.2", diff --git a/support/specsplit.js b/support/specsplit.js index c87f0b5..62f86f8 100755 --- a/support/specsplit.js +++ b/support/specsplit.js @@ -106,7 +106,7 @@ readFile(options.spec, 'utf8', function (error, input) { }); if (!options.type) { - console.log(util.format('passed samples - %s, failed samples - %s', good.length, bad.length)); + console.log(util.format('CM spec stat: passed samples - %s, failed samples - %s', good.length, bad.length)); } else { var data = options.type === 'good' ? good : bad;