think/packages/server/test/app.e2e-spec.ts

23 lines
610 B
TypeScript
Raw Normal View History

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