Christopher Hiller
Christopher Hiller
Seems like it works in v5.2.0 when using `--timeout 9999999`, but *not* `--timeout 0`, so there's obviously some further problem in the timeout-handling code.
(@segrey, nevermind, this doesn't have anything to do with webstorm)
So it looks like because timeouts are disabled within Mocha, and `unref()` was used, at that point in the stack there's nothing left in the event loop to do, so...
The bad news is, I'm not sure how to fix this other than suggest you use `--timeout 99999999999` to put something in the event loop to prevent the process from...
that's a separate bug. it causes the timeout to become `NaN` which ... I'm not sure what happens then.
(somebody please make a ticket for weirdness when the CLI parser thinks something like `timeout` is actually an `array`, which is what's happening...)
another workaround, if you can get away with removing `.unref()` I'd suggest doing that. or just calling `.ref()` on the timer from your test code if the `.unref()` is in...
@rolfl There is no fix (that I'm aware of) other than using `--timeout 999999`. This behavior is not new in Mocha v6.
> Before I try to go further, is the adding of the event-loop holding timeout a viable option, and if it is, is there a way to get the mocha...
> @juergba - that's true, I could. On the other hand, I would have to add it to all files/tests because it is common when in the IDE doing TDD...