diff --git a/app/backend/test/app.e2e-spec.ts b/app/backend/test/app.e2e-spec.ts index 1a013bef8..c808a15bf 100644 --- a/app/backend/test/app.e2e-spec.ts +++ b/app/backend/test/app.e2e-spec.ts @@ -1,12 +1,12 @@ import { Test, TestingModule } from '@nestjs/testing'; import { INestApplication } from '@nestjs/common'; import * as request from 'supertest'; -import { AppModule } from './../src/app.module'; +import { AppModule } from 'src/app.module'; describe('AppController (e2e)', () => { let app: INestApplication; - beforeEach(async () => { + beforeAll(async () => { const moduleFixture: TestingModule = await Test.createTestingModule({ imports: [AppModule], }).compile(); @@ -16,6 +16,10 @@ describe('AppController (e2e)', () => { }); it('/ (GET)', () => { - return request(app.getHttpServer()).get('/').expect(200).expect('Hello World!'); + return request(app.getHttpServer()).get('/').expect(200).expect('hello Morak'); + }); + + afterAll(async () => { + await app.close(); }); }); diff --git a/app/backend/test/jest-e2e.json b/app/backend/test/jest-e2e.json index e9d912f3e..4746c8ebe 100644 --- a/app/backend/test/jest-e2e.json +++ b/app/backend/test/jest-e2e.json @@ -5,5 +5,10 @@ "testRegex": ".e2e-spec.ts$", "transform": { "^.+\\.(t|j)s$": "ts-jest" + }, + "moduleNameMapper": { + "^src/(.*)$": "/../src/$1", + "^prisma/(.*)$": "/../prisma/$1", + "^libs/(.*)$": "/../libs/$1" } } diff --git a/app/backend/tsconfig.json b/app/backend/tsconfig.json index 670ef55de..219446453 100644 --- a/app/backend/tsconfig.json +++ b/app/backend/tsconfig.json @@ -3,5 +3,6 @@ "compilerOptions": { "outDir": "./dist", "baseUrl": "./", - }, + "allowJs": true + } }