From 88b11214701c97161df18fa151402996bdeb3b31 Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Mon, 15 Dec 2025 09:44:25 -0300 Subject: [PATCH] =?UTF-8?q?test(backoffice):=20=F0=9F=A7=AA=20added=20e2e?= =?UTF-8?q?=20test=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backoffice/test/app.e2e-spec.ts | 25 +++++++++++++++++++++++++ backoffice/test/jest-e2e.json | 9 +++++++++ 2 files changed, 34 insertions(+) create mode 100644 backoffice/test/app.e2e-spec.ts create mode 100644 backoffice/test/jest-e2e.json diff --git a/backoffice/test/app.e2e-spec.ts b/backoffice/test/app.e2e-spec.ts new file mode 100644 index 0000000..36852c5 --- /dev/null +++ b/backoffice/test/app.e2e-spec.ts @@ -0,0 +1,25 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { INestApplication } from '@nestjs/common'; +import request from 'supertest'; +import { App } from 'supertest/types'; +import { AppModule } from './../src/app.module'; + +describe('AppController (e2e)', () => { + let app: INestApplication; + + beforeEach(async () => { + const moduleFixture: TestingModule = await Test.createTestingModule({ + imports: [AppModule], + }).compile(); + + app = moduleFixture.createNestApplication(); + await app.init(); + }); + + it('/ (GET)', () => { + return request(app.getHttpServer()) + .get('/') + .expect(200) + .expect('Hello World!'); + }); +}); diff --git a/backoffice/test/jest-e2e.json b/backoffice/test/jest-e2e.json new file mode 100644 index 0000000..e9d912f --- /dev/null +++ b/backoffice/test/jest-e2e.json @@ -0,0 +1,9 @@ +{ + "moduleFileExtensions": ["js", "json", "ts"], + "rootDir": ".", + "testEnvironment": "node", + "testRegex": ".e2e-spec.ts$", + "transform": { + "^.+\\.(t|j)s$": "ts-jest" + } +}