-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Description
Jest does not closed himself after test finished
--detectOpenHandles suggest I need to close DNSCHANNEL manually:
Jest has detected the following 1 open handle potentially keeping Jest from exiting:
● DNSCHANNEL
at dns.js:333:23
But I cannot find any additonal information based on that problem.
I have async tests running supertest and jest.
"express": "^4.16.3",
"jest": "^23.1.0",
"supertest": "^3.1.0",
"pg": "^7.4.3",
"pg-pool": "^2.0.3"
Test code
const request = require('supertest');
const app = require('server');
// close the server after each test
afterEach(async () => {
await app.db.close();
});
const wFixture = [{
"complexity": 3,
}];
describe('Controllers', () => {
test('list get method', async () => {
const response = await request(app).get('/');
expect(response.status).toEqual(200);
expect(response.body.count).toEqual(1);
expect(response.body.data).toEqual(wFixture);
});
});
fguitton, andrewgu12, skarbovskiy, jmadan, thomasschiet and 14 more
Metadata
Metadata
Assignees
Labels
No labels