Wire API health endpoint
This commit is contained in:
1 parent
4115646d66
commit
34ae20476f
10 files changed
+104
-21
No files matched your search
@@ -2,7 +2,10 @@ import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import request from 'supertest';
|
||||
import { App } from 'supertest/types';
|
||||
import { configureApp } from './../src/app.setup';
|
||||
import { AppModule } from './../src/app.module';
|
||||
import { ConnectionService } from './../src/modules/global/database/connection.service';
|
||||
import { REDIS_CLIENT } from './../src/modules/global/redis/redis.constants';
|
||||
|
||||
describe('AppController (e2e)', () => {
|
||||
let app: INestApplication<App>;
|
||||
@@ -10,17 +13,26 @@ describe('AppController (e2e)', () => {
|
||||
beforeEach(async () => {
|
||||
const moduleFixture: TestingModule = await Test.createTestingModule({
|
||||
imports: [AppModule],
|
||||
}).compile();
|
||||
})
|
||||
.overrideProvider(ConnectionService)
|
||||
.useValue({})
|
||||
.overrideProvider(REDIS_CLIENT)
|
||||
.useValue({
|
||||
destroy: jest.fn(),
|
||||
quit: jest.fn().mockResolvedValue(undefined),
|
||||
})
|
||||
.compile();
|
||||
|
||||
app = moduleFixture.createNestApplication();
|
||||
configureApp(app);
|
||||
await app.init();
|
||||
});
|
||||
|
||||
it('/ (GET)', () => {
|
||||
it('/api/health (GET)', () => {
|
||||
return request(app.getHttpServer())
|
||||
.get('/')
|
||||
.get('/api/health')
|
||||
.expect(200)
|
||||
.expect('Hello World!');
|
||||
.expect({ status: 'ok' });
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
|
||||
Reference in new issue
Block a user