From 8f3c540794ee555d9bfd5fd92f25400ffd3e3a54 Mon Sep 17 00:00:00 2001 From: Antoni Kepinski Date: Tue, 14 Apr 2020 11:59:32 +0200 Subject: [PATCH] fix coverage report & update scripts --- .travis.yml | 3 +-- package.json | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20b2669..f1fc005 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,5 +12,4 @@ matrix: cache: npm -script: - - npm run coverage +after_success: npm run coverage diff --git a/package.json b/package.json index c23fdbc..828b35b 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,8 @@ "scripts": { "build": "pika build --out dist/", "prepublishOnly": "npm run build", - "test": "cross-env BABEL_ENV=test mocha --require @babel/register --throw-deprecation test/*.js", - "report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/*.js", - "coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/*.js && codecov -f coverage/coverage-final.json", + "test": "nyc --reporter=html --reporter=text mocha --require @babel/register --throw-deprecation", + "coverage": "nyc report --reporter=text-lcov | coveralls", "lint": "xo" }, "repository": { @@ -36,17 +35,18 @@ "@babel/core": "^7.9.0", "@babel/preset-env": "^7.9.5", "@babel/register": "^7.9.0", + "@istanbuljs/nyc-config-babel": "^3.0.0", "@pika/pack": "^0.5.0", "@pika/plugin-build-node": "^0.9.2", "@pika/plugin-standard-pkg": "^0.9.2", "abort-controller": "^3.0.0", "abortcontroller-polyfill": "^1.4.0", + "babel-plugin-istanbul": "^6.0.0", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "chai-iterator": "^3.0.2", "chai-string": "^1.5.0", - "codecov": "^3.6.5", - "cross-env": "^7.0.2", + "coveralls": "^3.0.11", "form-data": "^3.0.0", "mocha": "^7.1.1", "nyc": "^15.0.1", @@ -62,8 +62,12 @@ }, "@pika/pack": { "pipeline": [ - ["@pika/plugin-standard-pkg"], - ["@pika/plugin-build-node"] + [ + "@pika/plugin-standard-pkg" + ], + [ + "@pika/plugin-build-node" + ] ] }, "xo": { @@ -115,14 +119,13 @@ } } ] + ], + "plugins": [ + "istanbul" ] }, "nyc": { - "require": [ - "@babel/register" - ], - "sourceMap": false, - "instrument": false + "extends": "@istanbuljs/nyc-config-babel" }, "runkitExampleFilename": "example.js" }