Skip to content
Snippets Groups Projects
health.spec.ts 771 B
Newer Older
import type { TestingModule } from '@nestjs/testing';

zdravko iliev's avatar
zdravko iliev committed
import { HttpStatus } from '@nestjs/common';
import { Test } from '@nestjs/testing';

import HealthController from './health.controller.js';
zdravko iliev's avatar
zdravko iliev committed

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);
  });
});