DNSCHANNEL stops jest from closing
See original GitHub issueJest 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);
});
});
Issue Analytics
- State:
- Created 5 years ago
- Reactions:20
- Comments:20
Top Results From Across the Web
Jest detects open handle DNSCHANNEL if node package got ...
I'm programming server in Node.js v12.18.3 , using Express framework. My code uses Jest for unit testing. In one of my module, I've...
Read more >Testing Asynchronous Code - Jest
When you have code that runs asynchronously, Jest needs to know when the code it is testing has completed, before it can move...
Read more >Jest Detects Open Handle With Express App - ADocLib
erfanium posted onGitHub Jest has detected the following 1 open handle potentially keeping Jest from exiting: DNSCHANNEL at new CacheableLookup.
Read more >Jest shows a warning after updating got 11.5.1 - Issuehunt
Jest has detected the following 1 open handle potentially keeping Jest from exiting: ○ DNSCHANNEL at new CacheableLookup ...
Read more >Make Jest for LWC [closed] - Salesforce Stack Exchange
Stop defacing your question. The contents of your question are important for understanding the answer that you've received. This site isn't here ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can confirm that this issue still exists, in my case it does prevent jest to exit, thus requiring
--forceExit
:with all up-to-date versions:
I’m seeing the same issue here.