2022-02-20 19:51:55 +08:00
|
|
|
import { INestApplication } from '@nestjs/common';
|
2022-05-16 17:23:59 +08:00
|
|
|
import { Test, TestingModule } from '@nestjs/testing';
|
2022-02-20 19:51:55 +08:00
|
|
|
import * as request from 'supertest';
|
2022-05-16 17:23:59 +08:00
|
|
|
|
2022-02-20 19:51:55 +08:00
|
|
|
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)', () => {
|
2022-03-12 11:27:56 +08:00
|
|
|
return request(app.getHttpServer()).get('/').expect(200).expect('Hello World!');
|
2022-02-20 19:51:55 +08:00
|
|
|
});
|
|
|
|
});
|