diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48a9b32e..293f3cae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: docker compose -f docker-compose.dev.tests.opensearch.yml up -d --force-recreate opensearch-node1 postgres node sleep 60 docker compose -f docker-compose.dev.tests.opensearch.yml logs - docker compose -f docker-compose.dev.tests.opensearch.yml run -e NODE_OPTIONS=--unhandled-rejections=warn -e SEARCH_DRIVER=opensearch -e DB_DRIVER=postgres -e PUBSUB_TYPE=local node npm run test:all + docker compose -f docker-compose.dev.tests.opensearch.yml run -e NODE_OPTIONS="--unhandled-rejections=warn --experimental-vm-modules" -e SEARCH_DRIVER=opensearch -e DB_DRIVER=postgres -e PUBSUB_TYPE=local node npm run test:all docker compose -f docker-compose.dev.tests.opensearch.yml down build-frontend: diff --git a/tdrive/backend/node/package.json b/tdrive/backend/node/package.json index 120b4ab9..f0914910 100644 --- a/tdrive/backend/node/package.json +++ b/tdrive/backend/node/package.json @@ -22,14 +22,14 @@ "serve:watch": "nodemon dist/server.js | pino-pretty", "serve:debug": "nodemon --inspect dist/server.js | pino-pretty", "start": "npm run serve", - "test": "jest --forceExit --coverage --detectOpenHandles --runInBand --verbose false --experimental-vm-modules | pino-pretty", + "test": "jest --forceExit --coverage --detectOpenHandles --runInBand --verbose false | pino-pretty", "test:local": "jest --forceExit --detectOpenHandles --runInBand mock.spec.ts", "test:watch": "npm run test -- --watchAll --verbose false | pino-pretty", - "test:unit": "jest test/unit --forceExit --coverage --detectOpenHandles --maxWorkers=1 --testTimeout=30000 --verbose false --experimental-vm-modules > coverage/coverage-report.txt", + "test:unit": "jest test/unit --forceExit --coverage --detectOpenHandles --maxWorkers=1 --testTimeout=30000 --verbose false > coverage/coverage-report.txt", "test:unit:watch": "npm run test:unit -- --watchAll --verbose false | pino-pretty", "test:merge:json": "npx istanbul report --dir coverage/merged --include 'coverage/**/coverage-final.json' json-summary", "test:merge:text": "npx istanbul report --dir coverage/merged --include 'coverage/**/coverage-final.json' text > coverage/merged/coverage-report.txt", - "test:all": "jest test --forceExit --coverage --detectOpenHandles --testTimeout=600000 --verbose false --runInBand --experimental-vm-modules", + "test:all": "jest test --forceExit --coverage --detectOpenHandles --testTimeout=600000 --verbose false --runInBand", "kill": "kill $(lsof -t -i:3000) | exit 0" }, "jest": { diff --git a/tdrive/backend/node/test/e2e/utils.prepare.db.ts b/tdrive/backend/node/test/e2e/utils.prepare.db.ts index 21f1e8a7..8a89c08d 100644 --- a/tdrive/backend/node/test/e2e/utils.prepare.db.ts +++ b/tdrive/backend/node/test/e2e/utils.prepare.db.ts @@ -13,7 +13,7 @@ import { v1 as uuidv1 } from "uuid"; import CompanyUser from "../../src/services/user/entities/company_user"; import { DatabaseServiceAPI } from "../../src/core/platform/services/database/api"; import Repository from "../../src/core/platform/services/database/services/orm/repository/repository"; -import Device from "../../src/services/user/entities/device"; +import Device, { DeviceTypesEnum } from "../../src/services/user/entities/device"; import gr from "../../src/services/global-resolver"; @@ -204,14 +204,14 @@ export class TestDbService { async createDevice( options: { - id?: string; - password?: string; - user_id?: string; - company_id?: string; - type?: string; - version?: string; - push_notifications?: boolean; - } = {}, + id: string; + password: string; + user_id: string; + company_id: string; + type: DeviceTypesEnum; + version: string; + push_notifications: boolean; + }, ): Promise { const user = await gr.services.users.get( {id: options.user_id } ); const device = new Device();