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

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

import { AppModule } from '../src/app.module.js';
zdravko iliev's avatar
zdravko iliev committed

describe('HealthController (e2e)', () => {
  let app: INestApplication;

  beforeAll(async () => {
    const moduleFixture: TestingModule = await Test.createTestingModule({
      imports: [AppModule],
    }).compile();

    app = moduleFixture.createNestApplication();
    await app.init();
  });
zdravko iliev's avatar
zdravko iliev committed
  afterAll(async () => {
    await app.close();
  });

  it('/health (GET)', () =>
    request(app.getHttpServer()).get('/health').expect(200));
zdravko iliev's avatar
zdravko iliev committed
});