[SOLUTION] Jest and Fake Timers
DominicVonkPON opened this issue · 2 comments
DominicVonkPON commented
Discussed in #823
Originally posted by DominicVonkPON October 30, 2023
If you encounter a problem with Jest where the tests are not running due to the fake timers, it could be because MongoDB memory server relies on nextTick. To resolve this issue, you should avoid faking the nextTick function. By allowing the natural behavior of nextTick, you should be able to run the tests successfully with Jest.
jest.useFakeTimers({
doNotFake: ['nextTick'], // do not fake nextTick behavior for mongo in memory
});
hasezoey commented
why exactly was this opened as a issue too?