From 2e9dae3eecb0ccc985b9bca11c87a224d003f28a Mon Sep 17 00:00:00 2001 From: deyaaeldeen Date: Mon, 20 Jul 2020 17:42:32 -0400 Subject: [PATCH] factoring out coverage scripts so that mocha with ts-node can work with vscode debugger --- sdk/core/core-arm/package.json | 6 +++++- sdk/core/core-http/package.json | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sdk/core/core-arm/package.json b/sdk/core/core-arm/package.json index ea02c0cba460..c961b79931fe 100644 --- a/sdk/core/core-arm/package.json +++ b/sdk/core/core-arm/package.json @@ -87,7 +87,11 @@ "test": "npm run build && npm run unit-test && npm run integration-test", "unit-test": "npm run unit-test:node && npm run unit-test:browser", "unit-test:browser": "echo skipped", - "unit-test:node": "nyc mocha --require ts-node/register --timeout 50000 --reporter ../../../common/tools/mocha-multi-reporter.js --colors \"test/**/*.ts\"", + "unit-test:node": "mocha --require ts-node/register --timeout 50000 --reporter ../../../common/tools/mocha-multi-reporter.js --colors \"test/**/*.ts\"", + "cover:unit:browser": "nyc npm run unit-test:browser", + "cover:unit:node": "nyc npm run unit-test:node", + "cover:unit": "npm run cover:unit:node && npm run cover:unit:browser", + "cover:report": "nyc report --reporter=lcov --reporter=text", "pack": "npm pack 2>&1", "prebuild": "npm run clean" }, diff --git a/sdk/core/core-http/package.json b/sdk/core/core-http/package.json index d9c40b821433..00bf5674ad97 100644 --- a/sdk/core/core-http/package.json +++ b/sdk/core/core-http/package.json @@ -91,7 +91,11 @@ "test": "npm run build:test && npm run unit-test && npm run integration-test", "unit-test": "npm run unit-test:node && npm run unit-test:browser", "unit-test:browser": "node ./node_modules/karma/bin/karma start karma.conf.ts --browsers ChromeNoSecurity --single-run", - "unit-test:node": "cross-env TS_NODE_FILES=true nyc mocha --require ts-node/register --timeout 50000 --reporter ../../../common/tools/mocha-multi-reporter.js --colors --exclude \"test/**/*.browser.ts\" \"test/**/*.ts\"", + "unit-test:node": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --timeout 50000 --reporter ../../../common/tools/mocha-multi-reporter.js --colors --exclude \"test/**/*.browser.ts\" \"test/**/*.ts\"", + "cover:unit:browser": "nyc npm run unit-test:browser", + "cover:unit:node": "nyc npm run unit-test:node", + "cover:unit": "npm run cover:unit:node && npm run cover:unit:browser", + "cover:report": "nyc report --reporter=lcov --reporter=text", "check:packagejsonversion": "ts-node ./.scripts/checkPackageJsonVersion.ts", "check:foronlycalls": "ts-node ./.scripts/checkForOnlyCalls.ts", "check:everything": "ts-node ./.scripts/checkEverything.ts",