Newer
Older
import type { TestingModule } from '@nestjs/testing';
import { Test } from '@nestjs/testing';
import HealthController from './health.controller.js';
describe('Health', () => {
let healthController: HealthController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
imports: [],
controllers: [HealthController],
providers: [],
}).compile();
healthController = module.get<HealthController>(HealthController);
});
it('should be defined', () => {
expect(healthController).toBeDefined();
});
it('should call getHealth', () => {
const response = healthController.getHealth();
expect(response.statusCode).toBe(HttpStatus.OK);
});
});