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 no longer actively maintained and its repo is archived,
it's less likely that the issue will be fixed soon.

This change switches to use another code coverage tool `c8` which is not
affected. `c8` respects `.nycrc` config files so those are not renamed.
  • Loading branch information
jeremymeng committed Oct 23, 2023
1 parent f814d7d commit 75d31be
Show file tree
Hide file tree
Showing 109 changed files with 357 additions and 218 deletions.
354 changes: 248 additions & 106 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion common/tools/dev-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"eslint": "^8.0.0",
"mkdirp": "^1.0.4",
"mocha": "^10.0.0",
"nyc": "^15.1.0",
"c8": "^8.0.0",
"karma": "^6.3.9",
"rimraf": "^3.0.0"
}
Expand Down
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.2.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.2.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
4 changes: 2 additions & 2 deletions sdk/batch/batch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"mocha": "^10.0.0",
"mocha-junit-reporter": "^2.0.0",
"moment": "^2.29.1",
"nyc": "^15.1.0",
"c8": "^8.0.0",
"puppeteer": "^10.1.0",
"rimraf": "^3.0.2",
"rollup": "^1.16.3",
Expand Down Expand Up @@ -91,7 +91,7 @@
"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}\"",
"integration-test:browser": "karma start --single-run",
"itegration-test:node": "mocha -r ../../../common/tools/esm-workaround -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.spec.js\"",
"itegration-test:node": "c8 mocha -r ../../../common/tools/esm-workaround -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}/*.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",
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.2.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.2.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/core-sse/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.2",
"nyc": "^15.1.0",
"c8": "^8.0.0",
"prettier": "^2.5.1",
"puppeteer": "^19.2.2",
"rimraf": "^3.0.2",
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
Loading

0 comments on commit 75d31be

Please sign in to comment.