diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a23109..e8584d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,11 @@ jobs: - run: npm --prefix gatewayservice install - run: npm --prefix webapp install - run: npm --prefix webapp run build + env: + CI: false - run: npm --prefix webapp run test:e2e + env: + CI: false docker-push-webapp: name: Push webapp Docker Image to GitHub Packages runs-on: ubuntu-latest diff --git a/webapp/e2e/test-environment-setup.js b/webapp/e2e/test-environment-setup.js index 7b7ed51..39dd2d1 100644 --- a/webapp/e2e/test-environment-setup.js +++ b/webapp/e2e/test-environment-setup.js @@ -1,5 +1,4 @@ -const { MongoMemoryServer } = require('mongodb-memory-server'); - +import { MongoMemoryServer } from 'mongodb-memory-server'; let mongoserver; let userservice; @@ -7,13 +6,15 @@ let authservice; let gatewayservice; async function startServer() { - console.log('Starting MongoDB memory server...'); - mongoserver = await MongoMemoryServer.create(); - const mongoUri = mongoserver.getUri(); - process.env.MONGODB_URI = mongoUri; - userservice = await require("../../users/userservice/user-service"); - authservice = await require("../../users/authservice/auth-service"); - gatewayservice = await require("../../gatewayservice/gateway-service"); - } + console.log('Starting MongoDB memory server...'); + mongoserver = await MongoMemoryServer.create(); + const mongoUri = mongoserver.getUri(); + process.env.MONGODB_URI = mongoUri; + + userservice = (await import('../../users/userservice/user-service')).default; + authservice = (await import('../../users/authservice/auth-service')).default; + gatewayservice = (await import('../../gatewayservice/gateway-service')) + .default; +} - startServer(); +startServer(); diff --git a/webapp/package.json b/webapp/package.json index 2e30d72..865e2a8 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -2,6 +2,10 @@ "name": "webapp", "version": "0.1.0", "private": true, + "type": "module", + "jest": { + "transform": {} + }, "dependencies": { "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0",