Skip to content

Commit 0189623

Browse files
authored
🧹 Update mocha and remove resolutions (#18736)
* remove resolutions in root package.json update mocha to avoid pulling in [email protected] * adjust mocha config * also consider *.spec.db.* * re-add missing exclude of node_modules * remove recursive * fix mocha execution
1 parent 5303260 commit 0189623

File tree

13 files changed

+254
-219
lines changed

13 files changed

+254
-219
lines changed

components/gitpod-db/mocha.opts

Lines changed: 0 additions & 6 deletions
This file was deleted.

components/gitpod-db/package.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,25 @@
1212
"test": "yarn db-test",
1313
"watch": "leeway exec --package .:lib --transitive-dependencies --filter-type yarn --components --parallel -- tsc -w --preserveWatchOutput",
1414
"db-test": "r(){ . $(leeway run components/gitpod-db:db-test-env); yarn db-test-run; };r",
15-
"db-test-run": "mocha --opts mocha.opts '**/*.spec.db.ts' --exclude './node_modules/**'",
15+
"db-test-run": "mocha '**/*.spec.db.ts' --exclude './node_modules/**' --exit",
1616
"wait-for-db": "node ./lib/wait-for-db.js",
1717
"typeorm": "typeorm -f lib/typeorm/ormconfig",
1818
"migrate-migrations": "node ./lib/migrate-migrations.js",
1919
"clean": "yarn run rimraf lib",
2020
"clean:node": "yarn run rimraf node_modules",
2121
"purge": "yarn clean && yarn clean:node && yarn run rimraf yarn.lock"
2222
},
23+
"mocha": {
24+
"require": [
25+
"ts-node/register",
26+
"reflect-metadata/Reflect",
27+
"source-map-support/register"
28+
],
29+
"extensions": [
30+
"ts"
31+
],
32+
"exit": true
33+
},
2334
"files": [
2435
"/lib"
2536
],
@@ -38,14 +49,14 @@
3849
"devDependencies": {
3950
"@testdeck/mocha": "^0.3.3",
4051
"@types/chai": "^4.2.2",
41-
"@types/mocha": "^2.2.45",
52+
"@types/mocha": "^10.0.1",
4253
"@types/mysql": "^2.15.0",
4354
"@types/uuid": "^8.3.1",
4455
"@typescript-eslint/eslint-plugin": "^5.5.0",
4556
"@typescript-eslint/parser": "^5.5.0",
4657
"chai": "^4.2.0",
4758
"eslint": "^8.47.0",
48-
"mocha": "^4.1.0",
59+
"mocha": "^10.2.0",
4960
"rimraf": "^2.6.1",
5061
"ts-node": "^10.4.0",
5162
"typescript": "~4.4.2"

components/gitpod-protocol/mocha.opts

Lines changed: 0 additions & 6 deletions
This file was deleted.

components/gitpod-protocol/package.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@types/google-protobuf": "^3.15.5",
2020
"@types/jaeger-client": "^3.18.3",
2121
"@types/js-yaml": "^3.10.1",
22-
"@types/mocha": "^5.2.7",
22+
"@types/mocha": "^10.0.1",
2323
"@types/node": "^16.11.6",
2424
"@types/random-number-csprng": "^1.0.0",
2525
"@types/uuid": "^8.3.1",
@@ -29,7 +29,7 @@
2929
"chai": "^4.3.4",
3030
"chai-subset": "^1.6.0",
3131
"eslint": "^8.47.0",
32-
"mocha": "^5.0.0",
32+
"mocha": "^10.2.0",
3333
"rimraf": "^2.6.2",
3434
"ts-node": "^10.4.0",
3535
"typescript": "~4.4.2",
@@ -41,10 +41,21 @@
4141
"build": "yarn lint && tsc",
4242
"lint": "yarn eslint src/*.ts src/**/*.ts",
4343
"lint:fix": "yarn eslint src/*.ts src/**/*.ts --fix",
44-
"test": "mocha --opts mocha.opts './**/*.spec.ts' --exclude './node_modules/**'",
45-
"test-debug": "mocha --opts mocha.opts --inspect-brk './**/*.spec.ts' --exclude './node_modules/**'",
44+
"test": "mocha './**/*.spec.ts' --exclude './node_modules/**'",
45+
"test-debug": "mocha --inspect-brk './**/*.spec.ts' --exclude './node_modules/**' --exit",
4646
"watch": "leeway exec --package .:lib --transitive-dependencies --filter-type yarn --components --parallel -- tsc -w --preserveWatchOutput"
4747
},
48+
"mocha": {
49+
"require": [
50+
"ts-node/register",
51+
"reflect-metadata/Reflect",
52+
"source-map-support/register"
53+
],
54+
"extensions": [
55+
"ts"
56+
],
57+
"exit": true
58+
},
4859
"dependencies": {
4960
"@types/react": "17.0.32",
5061
"abort-controller-x": "^0.4.0",

components/public-api/typescript/mocha.opts

Lines changed: 0 additions & 6 deletions
This file was deleted.

components/public-api/typescript/package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,20 @@
1010
"scripts": {
1111
"build": "mkdir -p lib; tsc",
1212
"watch": "leeway exec --package .:lib --transitive-dependencies --filter-type yarn --components --parallel -- tsc -w --preserveWatchOutput",
13-
"test": "mocha --opts mocha.opts './**/*.spec.ts' --exclude './node_modules/**'",
13+
"test": "mocha './**/*.spec.ts' --exclude './node_modules/**' --exit",
1414
"test:brk": "yarn test --inspect-brk"
1515
},
16+
"mocha": {
17+
"require": [
18+
"ts-node/register",
19+
"reflect-metadata/Reflect",
20+
"source-map-support/register"
21+
],
22+
"extensions": [
23+
"ts"
24+
],
25+
"exit": true
26+
},
1627
"dependencies": {
1728
"@bufbuild/connect": "^0.13.0",
1829
"@bufbuild/protobuf": "^0.1.1",

components/server/mocha.opts

Lines changed: 0 additions & 5 deletions
This file was deleted.

components/server/package.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"purge": "yarn clean && yarn clean:node && yarn run rimraf yarn.lock",
1919
"test:leeway": "yarn build && yarn test",
2020
"test": "yarn test:unit && yarn test:db",
21-
"test:unit": "mocha --opts mocha.opts './**/*.spec.js' --exclude './node_modules/**'",
22-
"test:db": "cleanup() { echo 'Cleanup started'; yarn stop-services; }; trap cleanup EXIT; . $(leeway run components/gitpod-db:db-test-env) && yarn start-services && mocha --opts mocha.opts './**/*.spec.db.js' --exclude './node_modules/**'",
21+
"test:unit": "mocha './**/*.spec.js' --exclude './node_modules/**' --exit",
22+
"test:db": "cleanup() { echo 'Cleanup started'; yarn stop-services; }; trap cleanup EXIT; . $(leeway run components/gitpod-db:db-test-env) && yarn start-services && mocha './**/*.spec.db.js' --exclude './node_modules/**' --exit",
2323
"start-services": "yarn start-testdb && yarn start-redis && yarn start-spicedb",
2424
"stop-services": "yarn stop-redis && yarn stop-spicedb",
2525
"start-testdb": "leeway run components/gitpod-db:init-testdb",
@@ -29,6 +29,16 @@
2929
"stop-redis": "docker stop test-redis || true",
3030
"telepresence": "telepresence --swap-deployment server --method inject-tcp --run yarn start-inspect"
3131
},
32+
"mocha": {
33+
"require": [
34+
"reflect-metadata/Reflect",
35+
"source-map-support/register"
36+
],
37+
"extensions": [
38+
"js"
39+
],
40+
"exit": true
41+
},
3242
"files": [
3343
"/dist",
3444
"/src"
@@ -73,6 +83,7 @@
7383
"jsonwebtoken": "^9.0.0",
7484
"lodash.debounce": "^4.0.8",
7585
"longjohn": "^0.2.12",
86+
"minimatch": "^9.0.3",
7687
"nice-grpc-client-middleware-retry": "^2.0.1",
7788
"node-fetch": "^2.6.7",
7889
"opentracing": "^0.14.4",
@@ -110,7 +121,7 @@
110121
"@types/http-proxy": "^1.17.7",
111122
"@types/js-yaml": "^4.0.3",
112123
"@types/lodash.debounce": "^4.0.6",
113-
"@types/mocha": "^2.2.45",
124+
"@types/mocha": "^10.0.1",
114125
"@types/node": "^16.11.0",
115126
"@types/node-fetch": "^2.6.1",
116127
"@types/passport": "^1.0.7",
@@ -126,7 +137,7 @@
126137
"deep-equal-in-any-order": "^2.0.0",
127138
"eslint": "^8.47.0",
128139
"expect": "^1.20.2",
129-
"mocha": "^5.0.0",
140+
"mocha": "^10.2.0",
130141
"prettier": "^3.0.0",
131142
"rimraf": "^3.0.2",
132143
"source-map-loader": "^4.0.1",

components/ws-manager-api/typescript/package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,20 @@
1010
"scripts": {
1111
"build": "mkdir -p lib && cp -f src/*.js src/*d.ts lib && tsc",
1212
"watch": "leeway exec --package .:lib --transitive-dependencies --filter-type yarn --components --parallel -- tsc -w --preserveWatchOutput",
13-
"test": "mocha --opts mocha.opts './**/*.spec.ts' --exclude './node_modules/**'",
13+
"test": "mocha './**/*.spec.ts' --exclude './node_modules/**' --exit",
1414
"test:brk": "yarn test --inspect-brk"
1515
},
16+
"mocha": {
17+
"require": [
18+
"ts-node/register",
19+
"reflect-metadata/Reflect",
20+
"source-map-support/register"
21+
],
22+
"extensions": [
23+
"ts"
24+
],
25+
"exit": true
26+
},
1627
"dependencies": {
1728
"@gitpod/content-service": "0.1.5",
1829
"@gitpod/gitpod-protocol": "0.1.5",
@@ -29,7 +40,7 @@
2940
"chai": "^4.3.4",
3041
"grpc-tools": "^1.12.4",
3142
"grpc_tools_node_protoc_ts": "^5.3.2",
32-
"mocha": "^5.0.0",
43+
"mocha": "^10.2.0",
3344
"ts-node": "^10.4.0",
3445
"typescript": "~4.4.2",
3546
"typescript-formatter": "^7.2.2"

components/ws-manager-bridge/mocha.opts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)