From 11721200dbf208f3d708579f06764ff30fb698ce Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Fri, 18 Dec 2020 11:22:25 -0800 Subject: [PATCH 1/4] enable code coverage for tables --- sdk/tables/data-tables/.nycrc.json | 10 ++++++++++ sdk/tables/data-tables/package.json | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 sdk/tables/data-tables/.nycrc.json diff --git a/sdk/tables/data-tables/.nycrc.json b/sdk/tables/data-tables/.nycrc.json new file mode 100644 index 000000000000..29174b423579 --- /dev/null +++ b/sdk/tables/data-tables/.nycrc.json @@ -0,0 +1,10 @@ +{ + "include": ["dist-esm/src/**/*.js"], + "exclude": ["**/*.d.ts", "dist-esm/src/generated/*"], + "reporter": ["text-summary", "html", "cobertura"], + "exclude-after-remap": false, + "sourceMap": true, + "produce-source-map": true, + "instrument": true, + "all": true +} diff --git a/sdk/tables/data-tables/package.json b/sdk/tables/data-tables/package.json index 0ef0b0ceec77..8973f0e008c4 100644 --- a/sdk/tables/data-tables/package.json +++ b/sdk/tables/data-tables/package.json @@ -27,7 +27,7 @@ "extract-api": "tsc -p . && api-extractor run --local", "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "karma start --single-run --testMode=integration", - "integration-test:node": "mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/integration.index.node.js", + "integration-test:node": "nyc mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-esm/test/integration/*.spec.js dist-esm/test/unit/*.spec.js", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", "lint": "eslint package.json api-extractor.json src test --ext .ts", @@ -37,7 +37,7 @@ "test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node", "test": "npm run build:test && npm run unit-test && npm run integration-test", "unit-test:browser": "karma start --single-run --testMode=unit && npm run integration-test:browser", - "unit-test:node": "mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/unit.index.node.js && npm run integration-test:node", + "unit-test:node": "mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/unit.index.node.js", "unit-test": "npm run unit-test:node && npm run unit-test:browser", "docs": "typedoc --excludePrivate --excludeNotExported --mode file --out ./dist/docs ./src" }, From 05bdc3dc248ee2c338e534a3f3cc5b1ae52ce8af Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Fri, 18 Dec 2020 11:23:37 -0800 Subject: [PATCH 2/4] enable code coverage for tables --- sdk/tables/data-tables/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/tables/data-tables/package.json b/sdk/tables/data-tables/package.json index 8973f0e008c4..8b9682e9d34f 100644 --- a/sdk/tables/data-tables/package.json +++ b/sdk/tables/data-tables/package.json @@ -105,6 +105,7 @@ "mocha": "^7.1.1", "mocha-junit-reporter": "^1.18.0", "prettier": "^1.16.4", + "nyc": "^14.0.0", "rimraf": "^3.0.0", "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", From bf5201d512536c544c1a7930ec6175b3208b3608 Mon Sep 17 00:00:00 2001 From: HarshaNalluru Date: Thu, 24 Dec 2020 11:06:02 -0800 Subject: [PATCH 3/4] .nycrc.json -> .nycrc --- sdk/tables/data-tables/{.nycrc.json => .nycrc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sdk/tables/data-tables/{.nycrc.json => .nycrc} (100%) diff --git a/sdk/tables/data-tables/.nycrc.json b/sdk/tables/data-tables/.nycrc similarity index 100% rename from sdk/tables/data-tables/.nycrc.json rename to sdk/tables/data-tables/.nycrc From d0378744157ec6fef303f6f21827aa7668e20829 Mon Sep 17 00:00:00 2001 From: HarshaNalluru Date: Thu, 24 Dec 2020 11:24:13 -0800 Subject: [PATCH 4/4] fix integration-test:node command --- sdk/tables/data-tables/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/data-tables/package.json b/sdk/tables/data-tables/package.json index dfdaeefa3b96..cbf2646c1351 100644 --- a/sdk/tables/data-tables/package.json +++ b/sdk/tables/data-tables/package.json @@ -27,7 +27,7 @@ "extract-api": "tsc -p . && api-extractor run --local", "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "karma start --single-run --testMode=integration", - "integration-test:node": "nyc mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-esm/test/integration/*.spec.js dist-esm/test/unit/*.spec.js", + "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js dist-esm/test/integration/*.spec.js dist-esm/test/unit/*.spec.js", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", "lint": "eslint package.json api-extractor.json src test --ext .ts",