Replies: 2 comments 1 reply
-
If this code (the You can unref the interval so it doesn't stop the event loop from finishing: setInterval(() => {}, x).unref() Or if it's created in your test, clear it at the end: const interval = setInterval(x => {}, x)
test.after.always(() => clearInterval(interval)) |
Beta Was this translation helpful? Give feedback.
-
@novemberborn Thanks for the response. Basically, anything that keeps the event loop going will block the tests, and code refactoring is always good, but we should be given the option to switch between these 2 modes (force exit or not). Is there a way to trigger an old behavior and forcefully exit once the tests are done? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I was trying to migrate from [email protected] to [email protected] when I found that only 1 file was processed, and the execution was stuck until the timeout. Below is the config from package.json:
After a couple of hours of debugging, I found out that simple usage of
setInterval
blocks the whole process, and I would like to know what can cause this behavior, as it does not seem expected (especially because the whole execution is blocked, apparently without reason).How to reproduce it?
Add this code in any testing directory, as a separate file:
Beta Was this translation helpful? Give feedback.
All reactions