#Jest has detected the following 1 open handle?

4 messages · Page 1 of 1 (latest)

zealous oak
#

When running yarn test:e2e --detectOpenHandles I get this error, I'm not sure why the default test for the app module is causing this issue? Any ideas? Cheers

#

Full code snippet

import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import { AppModule } from './../src/app.module';

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

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

    app = moduleFixture.createNestApplication();
    await app.init();
  });

  it('/ (GET)', () => {
    return request(app.getHttpServer())
      .get('/')
      .expect(200)
      .expect('Hello World!');
  });

  afterAll(() => {
    //
  });
});
zealous oak
#

@gaunt compass - Any idea how I could solve this?