2024-02-03 14:41:32 +00:00
|
|
|
import { INestApplication } from "@nestjs/common";
|
|
|
|
import { Test, TestingModule } from "@nestjs/testing";
|
|
|
|
import * as request from "supertest";
|
|
|
|
import { AppModule } from "./../src/app.module";
|
2024-01-25 00:06:36 +00:00
|
|
|
|
2024-02-03 14:41:32 +00:00
|
|
|
describe("AppController (e2e)", () => {
|
|
|
|
let app: INestApplication;
|
2024-01-25 00:06:36 +00:00
|
|
|
|
2024-02-03 14:41:32 +00:00
|
|
|
beforeEach(async () => {
|
|
|
|
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
|
|
imports: [AppModule],
|
|
|
|
}).compile();
|
2024-01-25 00:06:36 +00:00
|
|
|
|
2024-02-03 14:41:32 +00:00
|
|
|
app = moduleFixture.createNestApplication();
|
|
|
|
await app.init();
|
|
|
|
});
|
2024-01-25 00:06:36 +00:00
|
|
|
|
2024-02-03 14:41:32 +00:00
|
|
|
it("/ (GET)", () => {
|
|
|
|
return request(app.getHttpServer())
|
|
|
|
.get("/")
|
|
|
|
.expect(200)
|
|
|
|
.expect("Hello World!");
|
|
|
|
});
|
2024-01-25 00:06:36 +00:00
|
|
|
});
|