mongoose: Stack overflow when testing with jest
I created a new project where I install the last version 4.8.1. I got the error about promise and use custom one.
export default () => {
mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost/todoAppRN');
mongoose.connection
.once('open', () => console.log('Connected to MongoDb'))
.on('error', err => console.warn('Warning', err));
};
The error don’t stop but if I go back to version 4.7.7 all work fine.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 55 (12 by maintainers)
Commits related to this issue
- Reverted to older version of Mongoose. See https://github.com/Automattic/mongoose/issues/4943 for updates on the root cause. — committed to iSCAD-plus/Dashboard by ntietz 7 years ago
- fix: add warning about running jest in jsdom environment Fix #5532 Re: #5513 Re: #4943 — committed to Automattic/mongoose by vkarpov15 7 years ago
Hey, I am also in 4.8.1 and I am getting a similar error. Trying to reproduce in a github repo so you can look at it. The situation is I am trying to save a schema with a subdocument and I recieve this error:
I’ll let you know if I figure anything out or get a github repo up.