cupidgpg/test/app.e2e-spec.ts

26 lines
708 B
TypeScript
Raw Normal View History

2024-07-27 13:27:38 +02:00
import { Test, TestingModule } from '@nestjs/testing'
import { INestApplication } from '@nestjs/common'
import request from 'supertest'
2024-07-27 12:55:13 +02:00
2024-07-27 13:27:38 +02:00
import { AppModule } from './../src/app.module.js'
2024-07-27 12:55:13 +02:00
describe('AppController (e2e)', () => {
2024-07-27 13:27:38 +02:00
let app: INestApplication
2024-07-27 12:55:13 +02:00
2024-07-27 13:27:38 +02:00
beforeEach(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
imports: [AppModule],
}).compile()
2024-07-27 12:55:13 +02:00
2024-07-27 13:27:38 +02:00
app = moduleFixture.createNestApplication()
await app.init()
})
2024-07-27 12:55:13 +02:00
2024-07-27 13:27:38 +02:00
it('/ (GET)', () => {
return request(app.getHttpServer())
.get('/')
.expect(200)
.expect((res) => res.headers['Content-Type'] == 'text/html')
})
})