You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
800 B
TypeScript
31 lines
800 B
TypeScript
import { Test, TestingModule } from '@nestjs/testing';
|
|
import { INestApplication } from '@nestjs/common';
|
|
import * as iosredis from 'ioredis'
|
|
import * as request from 'supertest';
|
|
import { AppModule } from './../src/app.module';
|
|
import { AppService } from 'src/app.service';
|
|
|
|
describe('AppController (e2e)', () => {
|
|
let app: INestApplication;
|
|
|
|
beforeEach(async () => {
|
|
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
imports: [AppModule],
|
|
providers:[AppService]
|
|
}).compile();
|
|
|
|
app = moduleFixture.createNestApplication();
|
|
await app.init();
|
|
});
|
|
afterAll(async () => {
|
|
// iosredis.disconnect()
|
|
});
|
|
|
|
it('/ (GET)', () => {
|
|
return request(app.getHttpServer())
|
|
.get('/')
|
|
.expect(200)
|
|
.expect('Hello World!');
|
|
});
|
|
});
|