diff --git a/components/gitpod-db/mocha.opts b/components/gitpod-db/mocha.opts deleted file mode 100644 index 33dbfa810d1530..00000000000000 --- a/components/gitpod-db/mocha.opts +++ /dev/null @@ -1,6 +0,0 @@ ---require ts-node/register ---require reflect-metadata/Reflect ---require source-map-support/register ---reporter spec ---watch-extensions ts ---exit \ No newline at end of file diff --git a/components/gitpod-db/package.json b/components/gitpod-db/package.json index 2e6480a8d55fea..cf55ce61ec5458 100644 --- a/components/gitpod-db/package.json +++ b/components/gitpod-db/package.json @@ -12,7 +12,7 @@ "test": "yarn db-test", "watch": "leeway exec --package .:lib --transitive-dependencies --filter-type yarn --components --parallel -- tsc -w --preserveWatchOutput", "db-test": "r(){ . $(leeway run components/gitpod-db:db-test-env); yarn db-test-run; };r", - "db-test-run": "mocha --opts mocha.opts '**/*.spec.db.ts' --exclude './node_modules/**'", + "db-test-run": "mocha '**/*.spec.db.ts'", "wait-for-db": "node ./lib/wait-for-db.js", "typeorm": "typeorm -f lib/typeorm/ormconfig", "migrate-migrations": "node ./lib/migrate-migrations.js", @@ -20,6 +20,20 @@ "clean:node": "yarn run rimraf node_modules", "purge": "yarn clean && yarn clean:node && yarn run rimraf yarn.lock" }, + "mocha": { + "require": [ + "ts-node/register", + "reflect-metadata/Reflect", + "source-map-support/register" + ], + "spec": [ + "src/**/*.spec.ts" + ], + "recursive": true, + "extensions": [ + "ts" + ] + }, "files": [ "/lib" ], diff --git a/components/gitpod-protocol/mocha.opts b/components/gitpod-protocol/mocha.opts deleted file mode 100644 index 33dbfa810d1530..00000000000000 --- a/components/gitpod-protocol/mocha.opts +++ /dev/null @@ -1,6 +0,0 @@ ---require ts-node/register ---require reflect-metadata/Reflect ---require source-map-support/register ---reporter spec ---watch-extensions ts ---exit \ No newline at end of file diff --git a/components/gitpod-protocol/package.json b/components/gitpod-protocol/package.json index b25dfcccf453f2..2f2b504ba3d0f1 100644 --- a/components/gitpod-protocol/package.json +++ b/components/gitpod-protocol/package.json @@ -41,10 +41,24 @@ "build": "yarn lint && tsc", "lint": "yarn eslint src/*.ts src/**/*.ts", "lint:fix": "yarn eslint src/*.ts src/**/*.ts --fix", - "test": "mocha --opts mocha.opts './**/*.spec.ts' --exclude './node_modules/**'", - "test-debug": "mocha --opts mocha.opts --inspect-brk './**/*.spec.ts' --exclude './node_modules/**'", + "test": "mocha './**/*.spec.ts'", + "test-debug": "mocha --inspect-brk './**/*.spec.ts'", "watch": "leeway exec --package .:lib --transitive-dependencies --filter-type yarn --components --parallel -- tsc -w --preserveWatchOutput" }, + "mocha": { + "require": [ + "ts-node/register", + "reflect-metadata/Reflect", + "source-map-support/register" + ], + "spec": [ + "src/**/*.spec.ts" + ], + "recursive": true, + "extensions": [ + "ts" + ] + }, "dependencies": { "@types/react": "17.0.32", "abort-controller-x": "^0.4.0", diff --git a/components/public-api/typescript/mocha.opts b/components/public-api/typescript/mocha.opts deleted file mode 100644 index 33dbfa810d1530..00000000000000 --- a/components/public-api/typescript/mocha.opts +++ /dev/null @@ -1,6 +0,0 @@ ---require ts-node/register ---require reflect-metadata/Reflect ---require source-map-support/register ---reporter spec ---watch-extensions ts ---exit \ No newline at end of file diff --git a/components/public-api/typescript/package.json b/components/public-api/typescript/package.json index 5a768aeb7a5eb0..3795d90e2a1991 100644 --- a/components/public-api/typescript/package.json +++ b/components/public-api/typescript/package.json @@ -10,9 +10,23 @@ "scripts": { "build": "mkdir -p lib; tsc", "watch": "leeway exec --package .:lib --transitive-dependencies --filter-type yarn --components --parallel -- tsc -w --preserveWatchOutput", - "test": "mocha --opts mocha.opts './**/*.spec.ts' --exclude './node_modules/**'", + "test": "mocha './**/*.spec.ts'", "test:brk": "yarn test --inspect-brk" }, + "mocha": { + "require": [ + "ts-node/register", + "reflect-metadata/Reflect", + "source-map-support/register" + ], + "spec": [ + "src/**/*.spec.ts" + ], + "recursive": true, + "extensions": [ + "ts" + ] + }, "dependencies": { "@bufbuild/connect-web": "^0.2.1", "@bufbuild/protobuf": "^0.1.1", diff --git a/components/server/mocha.opts b/components/server/mocha.opts deleted file mode 100644 index b7cf9f62da526d..00000000000000 --- a/components/server/mocha.opts +++ /dev/null @@ -1,5 +0,0 @@ ---require reflect-metadata/Reflect ---require source-map-support/register ---reporter spec ---watch-extensions js ---exit diff --git a/components/server/package.json b/components/server/package.json index 275441a353afc8..9b707e6323b42f 100644 --- a/components/server/package.json +++ b/components/server/package.json @@ -18,8 +18,8 @@ "purge": "yarn clean && yarn clean:node && yarn run rimraf yarn.lock", "test:leeway": "yarn build && yarn test", "test": "yarn test:unit && yarn test:db", - "test:unit": "mocha --opts mocha.opts './**/*.spec.js' --exclude './node_modules/**'", - "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/**'", + "test:unit": "mocha './**/*.spec.js' --exclude './node_modules/**'", + "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/**'", "start-services": "yarn start-testdb && yarn start-redis && yarn start-spicedb", "stop-services": "yarn stop-redis && yarn stop-spicedb", "start-testdb": "leeway run components/gitpod-db:init-testdb", @@ -29,6 +29,19 @@ "stop-redis": "docker stop test-redis || true", "telepresence": "telepresence --swap-deployment server --method inject-tcp --run yarn start-inspect" }, + "mocha": { + "require": [ + "reflect-metadata/Reflect", + "source-map-support/register" + ], + "spec": [ + "dist/**/*.spec.js" + ], + "recursive": true, + "extensions": [ + "js" + ] + }, "files": [ "/dist", "/src" diff --git a/components/ws-manager-api/typescript/package.json b/components/ws-manager-api/typescript/package.json index 56728636eb4400..365c1a623b1dce 100644 --- a/components/ws-manager-api/typescript/package.json +++ b/components/ws-manager-api/typescript/package.json @@ -10,9 +10,23 @@ "scripts": { "build": "mkdir -p lib && cp -f src/*.js src/*d.ts lib && tsc", "watch": "leeway exec --package .:lib --transitive-dependencies --filter-type yarn --components --parallel -- tsc -w --preserveWatchOutput", - "test": "mocha --opts mocha.opts './**/*.spec.ts' --exclude './node_modules/**'", + "test": "mocha './**/*.spec.ts' --exclude './node_modules/**'", "test:brk": "yarn test --inspect-brk" }, + "mocha": { + "require": [ + "ts-node/register", + "reflect-metadata/Reflect", + "source-map-support/register" + ], + "spec": [ + "src/**/*.spec.ts" + ], + "recursive": true, + "extensions": [ + "ts" + ] + }, "dependencies": { "@gitpod/content-service": "0.1.5", "@gitpod/gitpod-protocol": "0.1.5", diff --git a/components/ws-manager-bridge/mocha.opts b/components/ws-manager-bridge/mocha.opts deleted file mode 100644 index 972579ee21ef81..00000000000000 --- a/components/ws-manager-bridge/mocha.opts +++ /dev/null @@ -1,6 +0,0 @@ ---require ts-node/register ---require reflect-metadata/Reflect ---require source-map-support/register ---reporter spec ---watch-extensions ts ---exit diff --git a/components/ws-manager-bridge/package.json b/components/ws-manager-bridge/package.json index 4e0f655bb79f75..bdf8e746e953c2 100644 --- a/components/ws-manager-bridge/package.json +++ b/components/ws-manager-bridge/package.json @@ -5,7 +5,7 @@ "license": "UNLICENSED", "scripts": { "start": "node ./dist/index.js", - "test": "mocha --opts mocha.opts './**/*.spec.ts' --exclude './node_modules/**'", + "test": "mocha './**/*.spec.ts'", "lint": "yarn eslint src/*.ts src/**/*.ts", "lint:fix": "yarn eslint src/*.ts src/**/*.ts --fix", "build": "yarn lint && npx tsc", @@ -19,6 +19,20 @@ "debug": "nodemon -w ./dist --inspect=9300 ./dist/index.js", "telepresence": "leeway run .:telepresence" }, + "mocha": { + "require": [ + "ts-node/register", + "reflect-metadata/Reflect", + "source-map-support/register" + ], + "spec": [ + "src/**/*.spec.ts" + ], + "recursive": true, + "extensions": [ + "ts" + ] + }, "files": [ "/dist" ],