Skip to content

Commit

Permalink
adjust mocha config
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev committed Sep 18, 2023
1 parent 1dfddf8 commit 2ec77ce
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 37 deletions.
6 changes: 0 additions & 6 deletions components/gitpod-db/mocha.opts

This file was deleted.

16 changes: 15 additions & 1 deletion components/gitpod-db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,28 @@
"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",
"clean": "yarn run rimraf lib",
"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"
],
Expand Down
6 changes: 0 additions & 6 deletions components/gitpod-protocol/mocha.opts

This file was deleted.

18 changes: 16 additions & 2 deletions components/gitpod-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 0 additions & 6 deletions components/public-api/typescript/mocha.opts

This file was deleted.

16 changes: 15 additions & 1 deletion components/public-api/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 0 additions & 5 deletions components/server/mocha.opts

This file was deleted.

17 changes: 15 additions & 2 deletions components/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
16 changes: 15 additions & 1 deletion components/ws-manager-api/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 0 additions & 6 deletions components/ws-manager-bridge/mocha.opts

This file was deleted.

16 changes: 15 additions & 1 deletion components/ws-manager-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
],
Expand Down

0 comments on commit 2ec77ce

Please sign in to comment.