Skip to content

Commit

Permalink
[engsys] replace dev dependency nyc with c8
Browse files Browse the repository at this point in the history
***NO_CI***

The combination of `nyc` + `esm` is broken in latest versions of
NodeJS (istanbuljs/nyc#1530 (comment)).
Since `esm` package is not actively maintained and its repo is archived, it's
less likely that the issue will be fixed.

This PR switches to use another code coverage tool `c8` which is not affected.
`c8` also respects `.nycrc` config files so those are not renamed in this PR.
  • Loading branch information
jeremymeng committed Oct 23, 2023
1 parent f0ff24f commit 78a895f
Show file tree
Hide file tree
Showing 103 changed files with 343 additions and 209 deletions.
345 changes: 241 additions & 104 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion common/tools/dev-tool/src/commands/run/testNodeJSInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default leafCommand(commandInfo, async (options) => {
? updatedArgs?.join(" ")
: '--timeout 5000000 "dist-esm/test/{,!(browser)/**/}/*.spec.js"';
const command = {
command: `mocha ${defaultMochaArgs} ${mochaArgs}`,
command: `c8 mocha ${defaultMochaArgs} ${mochaArgs}`,
name: "node-tests",
};

Expand Down
2 changes: 1 addition & 1 deletion sdk/agrifood/agrifood-farming-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"mkdirp": "^1.0.4",
"mocha-junit-reporter": "^2.0.0",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
Expand Down
2 changes: 1 addition & 1 deletion sdk/anomalydetector/ai-anomaly-detector-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.3.8",
"karma": "^6.2.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"csv-parse": "^5.0.3",
"ts-node": "^10.0.0",
"esm": "^3.2.18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"prettier": "^2.5.1",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"rimraf": "^3.0.0",
"ts-node": "^10.0.0",
"typescript": "~5.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"prettier": "^2.5.1",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"rimraf": "^3.0.0",
"typescript": "~5.0.0",
"util": "^0.12.1",
Expand Down
3 changes: 1 addition & 2 deletions sdk/appconfiguration/app-configuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-* types *.tgz *.log",
"coverage": "nyc --reporter=lcov --exclude-after-remap=false mocha -t 120000 dist-test/index.js --reporter ../../../common/tools/mocha-multi-reporter.js",
"execute:samples": "dev-tool samples run samples-dev",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
Expand Down Expand Up @@ -123,7 +122,7 @@
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nock": "^12.0.3",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/appservice/arm-appservice-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.3.8",
"karma": "^6.2.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"ts-node": "^10.0.0",
"esm": "^3.2.18"
},
Expand Down
2 changes: 1 addition & 1 deletion sdk/attestation/attestation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"safe-buffer": "^5.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"karma-source-map-support": "~1.4.0",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"sinon": "^15.0.0",
"source-map-support": "^0.5.9",
Expand Down
2 changes: 1 addition & 1 deletion sdk/cognitivelanguage/ai-language-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"karma-source-map-support": "~1.4.0",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/test-utils": "^1.0.0",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"ts-node": "^10.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cognitivelanguage/ai-language-textauthoring/README.md",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-alpha-ids/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"karma": "^6.2.0",
"mocha-junit-reporter": "^2.0.0",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"typescript": "~5.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"process": "^0.11.10",
"rimraf": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.4.0",
"karma": "^6.2.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"ts-node": "^10.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/communication/communication-job-router-rest/README.md",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-job-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"karma": "^6.2.0",
"mocha-junit-reporter": "^1.18.0",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-phone-numbers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"karma": "^6.2.0",
"mocha-junit-reporter": "^2.0.0",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-rooms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"karma-env-preprocessor": "^0.1.1",
"mkdirp": "^1.0.4",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-short-codes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-sms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"karma": "^6.2.0",
"mocha-junit-reporter": "^2.0.0",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-tiering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/compute/arm-compute-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.3.8",
"karma": "^6.2.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"@azure/arm-network": "^32.2.0",
"ts-node": "^10.0.0",
"esm": "^3.2.18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"eslint": "^8.0.0",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
Expand Down
2 changes: 1 addition & 1 deletion sdk/containerregistry/container-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"typescript": "~5.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.3.8",
"karma": "^6.2.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"ts-node": "^10.0.0",
"esm": "^3.2.18"
},
Expand Down
2 changes: 1 addition & 1 deletion sdk/contentsafety/ai-content-safety-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.3.8",
"karma": "^6.2.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"@azure/core-util": "^1.4.0",
"esm": "^3.2.18"
},
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/abort-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"ts-node": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-amqp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"karma-mocha": "^2.0.1",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"puppeteer": "^19.2.2",
"rimraf": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"puppeteer": "^19.2.2",
"regenerator-runtime": "^0.13.3",
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-lro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"ts-node": "^10.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"puppeteer": "^19.2.2",
"rimraf": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/devcenter/developer-devcenter-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"karma-source-map-support": "~1.4.0",
"karma-sourcemap-loader": "^0.3.8",
"karma": "^6.2.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"ts-node": "^10.0.0",
"esm": "^3.2.18"
},
Expand Down
3 changes: 1 addition & 2 deletions sdk/digitaltwins/digital-twins-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"build:samples": "echo Obsolete.",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm dist-browser test-dist test-browser types *.tgz *.log",
"coverage": "nyc --reporter=lcov --exclude-after-remap=false mocha -t 120000 dist-test/index.node.js --reporter ../../../common/tools/mocha-multi-reporter.js",
"execute:js-samples": "node ../../../common/scripts/run-samples.js samples/javascript/",
"execute:samples": "dev-tool samples run samples-dev",
"extract-api": "tsc -p . && api-extractor run --local",
Expand Down Expand Up @@ -101,7 +100,7 @@
"karma-sourcemap-loader": "^0.3.8",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^15.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"karma": "^6.2.0",
"mocha-junit-reporter": "^2.0.0",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
Expand Down
2 changes: 1 addition & 1 deletion sdk/easm/defender-easm-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"mkdirp": "^1.0.4",
"mocha-junit-reporter": "^2.0.0",
"mocha": "^10.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
Expand Down
2 changes: 1 addition & 1 deletion sdk/entra/functions-authentication-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"karma-mocha-reporter": "^2.2.5",
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
Expand Down
Loading

0 comments on commit 78a895f

Please sign in to comment.