cupidgpg/test/app.e2e-spec.ts

27 lines
751 B
TypeScript
Raw Normal View History

2024-07-28 06:52:20 +02:00
import type { TestingModule } from '@nestjs/testing'
import { Test } from '@nestjs/testing'
import type { INestApplication } from '@nestjs/common'
2024-07-27 13:27:38 +02:00
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')
})
})