2024-07-27 13:31:25 +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')
|
|
|
|
})
|
|
|
|
})
|