Skip to content

Commit d056d21

Browse files
authored
chore: upgrade to mocha@10 (open-telemetry#2481)
From mocha@7. Drop use of ts-mocha in favour of a .mocharc.yml. This mimicks the same mocha@10 update that was done in opentelemetry-js.git a long while back. - The mocha dep has been moved to the top-level and taken out of individual some-workspace/package.json files. I found that this workaround an npm layout issue where we would get many installs of mocha (one in each using workspace dir's own `node_modules/`). There is prior art: `eslint` deps are only at the top-level. Refs: open-telemetry#1826 (comment)
1 parent 86dba74 commit d056d21

File tree

68 files changed

+8103
-14498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+8103
-14498
lines changed

.mocharc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require: 'ts-node/register/transpile-only'

archive/opentelemetry-browser-extension-autoinjection/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint:fix": "eslint . --fix",
1313
"precompile": "tsc --version && lerna run version:update --scope @opentelemetry/browser-extension-autoinjection --include-dependencies",
1414
"prewatch": "npm run precompile",
15-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
15+
"test": "nyc mocha 'test/**/*.test.ts'",
1616
"tdd": "npm run test -- --watch-extensions ts --watch",
1717
"watch": "npx webpack --mode=development --watch",
1818
"watch:mv2": "npx webpack --mode=development --watch --env MV=2",
@@ -47,15 +47,13 @@
4747
"html-webpack-plugin": "5.3.2",
4848
"jimp": "0.16.1",
4949
"jsdom": "15.2.1",
50-
"mocha": "7.2.0",
5150
"null-loader": "4.0.1",
5251
"nyc": "15.1.0",
5352
"responsive-loader": "2.3.0",
5453
"rimraf": "4.2.0",
5554
"sinon": "15.0.1",
5655
"sinon-chrome": "3.0.1",
5756
"ts-loader": "9.2.5",
58-
"ts-mocha": "10.0.0",
5957
"typescript": "4.4.4",
6058
"webpack": "4.46.0",
6159
"webpack-cli": "4.7.2",

detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-alibaba-cloud --include-dependencies",
1414
"prewatch": "npm run precompile",
1515
"prepublishOnly": "npm run compile",
16-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
16+
"test": "nyc mocha 'test/**/*.test.ts'",
1717
"tdd": "npm run test -- --watch-extensions ts --watch",
1818
"watch": "tsc -w"
1919
},
@@ -44,20 +44,18 @@
4444
"@types/mocha": "8.2.3",
4545
"@types/node": "18.18.14",
4646
"@types/sinon": "10.0.20",
47-
"mocha": "7.2.0",
4847
"nock": "13.3.3",
4948
"nyc": "15.1.0",
5049
"rimraf": "5.0.10",
5150
"sinon": "15.2.0",
52-
"ts-mocha": "10.0.0",
5351
"typescript": "4.4.4"
5452
},
5553
"peerDependencies": {
5654
"@opentelemetry/api": "^1.0.0"
5755
},
5856
"dependencies": {
59-
"@opentelemetry/resources": "^1.10.0",
6057
"@opentelemetry/core": "^1.26.0",
58+
"@opentelemetry/resources": "^1.10.0",
6159
"@opentelemetry/semantic-conventions": "^1.27.0"
6260
},
6361
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/detectors/node/opentelemetry-resource-detector-alibaba-cloud#readme"

detectors/node/opentelemetry-resource-detector-aws/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-aws --include-dependencies",
1414
"prewatch": "npm run precompile",
1515
"prepublishOnly": "npm run compile",
16-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
16+
"test": "nyc mocha 'test/**/*.test.ts'",
1717
"tdd": "npm run test -- --watch-extensions ts --watch",
1818
"watch": "tsc -w"
1919
},
@@ -43,12 +43,10 @@
4343
"@types/mocha": "8.2.3",
4444
"@types/node": "18.18.14",
4545
"@types/sinon": "10.0.20",
46-
"mocha": "7.2.0",
4746
"nock": "13.3.3",
4847
"nyc": "15.1.0",
4948
"rimraf": "5.0.10",
5049
"sinon": "15.2.0",
51-
"ts-mocha": "10.0.0",
5250
"typescript": "4.4.4"
5351
},
5452
"peerDependencies": {

detectors/node/opentelemetry-resource-detector-azure/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-azure --include-dependencies",
1414
"prewatch": "npm run precompile",
1515
"prepublishOnly": "npm run compile",
16-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
16+
"test": "nyc mocha 'test/**/*.test.ts'",
1717
"tdd": "npm run test -- --watch-extensions ts --watch",
1818
"watch": "tsc -w"
1919
},
@@ -36,11 +36,9 @@
3636
"@types/mocha": "8.2.3",
3737
"@types/node": "18.18.14",
3838
"@types/sinon": "10.0.20",
39-
"mocha": "7.2.0",
4039
"nock": "13.3.3",
4140
"nyc": "15.1.0",
4241
"rimraf": "5.0.10",
43-
"ts-mocha": "10.0.0",
4442
"typescript": "4.4.4"
4543
},
4644
"peerDependencies": {

detectors/node/opentelemetry-resource-detector-container/package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-container --include-dependencies",
1414
"prewatch": "npm run precompile",
1515
"prepublishOnly": "npm run compile",
16-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
16+
"test": "nyc mocha 'test/**/*.test.ts'",
1717
"tdd": "npm run test -- --watch-extensions ts --watch",
1818
"version:update": "node ../../../scripts/version-update.js",
1919
"watch": "tsc -w"
@@ -38,20 +38,18 @@
3838
"@types/node": "18.18.14",
3939
"@types/sinon": "10.0.20",
4040
"eslint-plugin-header": "^3.1.1",
41-
"mocha": "7.2.0",
4241
"nock": "13.3.3",
4342
"nyc": "15.1.0",
4443
"rimraf": "5.0.10",
4544
"sinon": "15.2.0",
46-
"ts-mocha": "10.0.0",
4745
"typescript": "4.4.4"
4846
},
4947
"peerDependencies": {
5048
"@opentelemetry/api": "^1.0.0"
5149
},
5250
"dependencies": {
53-
"@opentelemetry/resources": "^1.10.0",
5451
"@opentelemetry/core": "^1.26.0",
52+
"@opentelemetry/resources": "^1.10.0",
5553
"@opentelemetry/semantic-conventions": "^1.27.0"
5654
},
5755
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/detectors/node/opentelemetry-resource-detector-container#readme"

detectors/node/opentelemetry-resource-detector-gcp/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-gcp --include-dependencies",
1414
"prewatch": "npm run precompile",
1515
"prepublishOnly": "npm run compile",
16-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
16+
"test": "nyc mocha 'test/**/*.test.ts'",
1717
"tdd": "npm run test -- --watch-extensions ts --watch",
1818
"watch": "tsc -w"
1919
},
@@ -43,11 +43,9 @@
4343
"@types/mocha": "8.2.3",
4444
"@types/node": "18.18.14",
4545
"@types/semver": "7.5.8",
46-
"mocha": "7.2.0",
4746
"nock": "13.3.3",
4847
"nyc": "15.1.0",
4948
"rimraf": "5.0.10",
50-
"ts-mocha": "10.0.0",
5149
"typescript": "4.4.4"
5250
},
5351
"peerDependencies": {

detectors/node/opentelemetry-resource-detector-github/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-github --include-dependencies",
1414
"prewatch": "npm run precompile",
1515
"prepublishOnly": "npm run compile",
16-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
16+
"test": "nyc mocha 'test/**/*.test.ts'",
1717
"tdd": "npm run test -- --watch-extensions ts --watch",
1818
"watch": "tsc -w"
1919
},
@@ -46,11 +46,9 @@
4646
"@types/mocha": "8.2.3",
4747
"@types/node": "18.18.14",
4848
"@types/sinon": "10.0.20",
49-
"mocha": "7.2.0",
5049
"nyc": "15.1.0",
5150
"rimraf": "5.0.10",
5251
"sinon": "15.2.0",
53-
"ts-mocha": "10.0.0",
5452
"typescript": "4.4.4"
5553
},
5654
"dependencies": {

detectors/node/opentelemetry-resource-detector-instana/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-instana --include-dependencies",
1414
"prewatch": "npm run precompile",
1515
"prepublishOnly": "npm run compile",
16-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
16+
"test": "nyc mocha 'test/**/*.test.ts'",
1717
"tdd": "npm run test -- --watch-extensions ts --watch",
1818
"watch": "tsc -w"
1919
},
@@ -43,11 +43,9 @@
4343
"@types/mocha": "8.2.3",
4444
"@types/node": "18.18.14",
4545
"@types/semver": "7.5.8",
46-
"mocha": "7.2.0",
4746
"nock": "13.3.3",
4847
"nyc": "15.1.0",
4948
"rimraf": "5.0.10",
50-
"ts-mocha": "10.0.0",
5149
"typescript": "4.4.4"
5250
},
5351
"dependencies": {

incubator/opentelemetry-sampler-aws-xray/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
3737
"prepublishOnly": "npm run compile",
3838
"tdd": "npm run test -- --watch-extensions ts --watch",
39-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
39+
"test": "nyc mocha 'test/**/*.test.ts'",
4040
"version:update": "node ../../scripts/version-update.js",
4141
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
4242
},
@@ -58,11 +58,9 @@
5858
"@typescript-eslint/parser": "5.8.1",
5959
"eslint": "8.7.0",
6060
"expect": "29.2.0",
61-
"mocha": "7.2.0",
6261
"nock": "13.3.3",
6362
"nyc": "15.1.0",
6463
"sinon": "15.2.0",
65-
"ts-mocha": "10.0.0",
6664
"typescript": "4.4.4"
6765
},
6866
"engines": {

metapackages/auto-configuration-propagators/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"prewatch": "npm run precompile",
2424
"prepublishOnly": "npm run compile",
2525
"tdd": "npm run test -- --watch-extensions ts --watch",
26-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.ts'",
26+
"test": "nyc mocha 'test/**/*.ts'",
2727
"watch": "tsc -w"
2828
},
2929
"bugs": {
@@ -37,11 +37,9 @@
3737
"@types/mocha": "7.0.2",
3838
"@types/node": "18.18.14",
3939
"@types/sinon": "10.0.20",
40-
"mocha": "7.2.0",
4140
"nyc": "15.1.0",
4241
"rimraf": "5.0.10",
4342
"sinon": "15.2.0",
44-
"ts-mocha": "10.0.0",
4543
"typescript": "4.4.4"
4644
},
4745
"dependencies": {

metapackages/auto-instrumentations-node/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"prewatch": "npm run precompile",
2828
"prepublishOnly": "npm run compile",
2929
"tdd": "yarn test -- --watch-extensions ts --watch",
30-
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.ts'",
30+
"test": "nyc mocha 'test/**/*.ts'",
3131
"watch": "tsc -w"
3232
},
3333
"bugs": {
@@ -41,11 +41,9 @@
4141
"@types/mocha": "7.0.2",
4242
"@types/node": "18.18.14",
4343
"@types/sinon": "10.0.20",
44-
"mocha": "7.2.0",
4544
"nyc": "15.1.0",
4645
"rimraf": "5.0.10",
4746
"sinon": "15.2.0",
48-
"ts-mocha": "10.0.0",
4947
"typescript": "4.4.4"
5048
},
5149
"dependencies": {

metapackages/auto-instrumentations-web/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@
5252
"karma-mocha": "2.0.1",
5353
"karma-spec-reporter": "0.0.36",
5454
"karma-webpack": "5.0.1",
55-
"mocha": "10.2.0",
5655
"nyc": "15.1.0",
5756
"rimraf": "5.0.10",
5857
"sinon": "15.1.2",
5958
"ts-loader": "9.5.1",
60-
"ts-mocha": "10.0.0",
6159
"typescript": "4.4.4",
6260
"webpack": "5.94.0",
6361
"webpack-cli": "5.1.4",

0 commit comments

Comments
 (0)