You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although similar mongoose integration issues exist in this tracker, most deal primarily with failure to close mongoose connections properly. I believe this issue is unique, in that it is caused by simply requiring mongoose in a test.
Importing Mongoose as a dependency (or any JS module that depends on Mongoose) causes the following message when Jest is run with --detectOpenHandles:
> jest int --detectOpenHandles
PASS ./main.int.test.js
✓ true is true (6ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 1.524s, estimated 2s
Ran all test suites matching /int/i.
Jest has detected the following 1 open handle potentially keeping Jest from exiting:
● DNSCHANNEL
at dns.js:338:23
To Reproduce
/** * Dependencies */constmongoose=require('mongoose');test('true is true',()=>{expect(true).toBe(true);})
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🐛 Bug Report
Although similar mongoose integration issues exist in this tracker, most deal primarily with failure to close mongoose connections properly. I believe this issue is unique, in that it is caused by simply requiring mongoose in a test.
Importing Mongoose as a dependency (or any JS module that depends on Mongoose) causes the following message when Jest is run with --detectOpenHandles:
To Reproduce
Expected behavior
The test should be able to include modules that use mongoose as a dependency and terminate properly.
Link to Repo
https://github.com/CBFay/jest-mongoose-open-handle
Run
npx envinfo --preset jest
Paste the results here:
System: OS: macOS Sierra 10.12.6 CPU: (4) x64 Intel(R) Core(TM) i5-4260U CPU @ 1.40GHz Binaries: Node: 10.5.0 - /usr/local/bin/node npm: 6.1.0 - /usr/local/bin/npm npmPackages: jest: ^23.5.0 => 23.6.0
The text was updated successfully, but these errors were encountered: