project-knedita/test/app.e2e-spec.ts

25 lines
603 B
TypeScript
Raw Normal View History

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-02-03 14:41:32 +00:00
describe("AppController (e2e)", () => {
let app: INestApplication;
2024-02-03 14:41:32 +00:00
beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile();
2024-02-03 14:41:32 +00:00
app = moduleFixture.createNestApplication();
await app.init();
});
2024-02-03 14:41:32 +00:00
it("/ (GET)", () => {
return request(app.getHttpServer())
.get("/")
.expect(200)
.expect("Hello World!");
});
});