twenty/server/test/app.e2e-spec.ts

32 lines
685 B
TypeScript
Raw Normal View History

2022-12-01 17:58:08 +03:00
import { INestApplication } from '@nestjs/common';
import request from 'supertest';
import { createApp } from './utils/create-app';
2022-12-01 17:58:08 +03:00
describe('AppController (e2e)', () => {
let app: INestApplication;
beforeEach(async () => {
[app] = await createApp();
});
2022-12-01 17:58:08 +03:00
afterEach(async () => {
await app.close();
2022-12-01 17:58:08 +03:00
});
it('/healthz (GET)', () => {
2022-12-01 17:58:08 +03:00
return request(app.getHttpServer())
.get('/healthz')
2022-12-01 17:58:08 +03:00
.expect(200)
.expect((response) => {
expect(response.body).toEqual({
status: 'ok',
info: { database: { status: 'up' } },
error: {},
details: { database: { status: 'up' } },
});
});
2022-12-01 17:58:08 +03:00
});
});