Still having issues, but I have simplified the exa...
# javascript
m
Still having issues, but I have simplified the example:
Copy code
@Test
 fun testLongDelay() = kotlinx.coroutines.test.runTest(dispatchTimeoutMs = 16000) {
    withContext(Dispatchers.Default) {
        withTimeout(16000) {
            delay(15001)
        }
    }
}
This results in the following error:
Copy code
Error: Timeout of 15000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
Error: Timeout of 15000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
	at <global>.listOnTimeout(node:internal/timers:557)
	at <global>.processTimers(node:internal/timers:500)
I'm doing everything I can think of and I still can't figure out how to have a test that: 1. Bypasses the delay skipping mechanic of runTest 2. Is allowed to run for longer than 15000ms Any and all help is welcome.
j
It's the test runner. Mocha or Karma or whatever you've configured / the default.
๐Ÿ‘๐Ÿพ 1
m
Oh my thank you @jw that's it
Copy code
nodejs {
            testTask {
                useMocha {
                    // Fix Node JS test timeout issue (2s by default)
                    timeout = "15s"
                }
            }
        }
That was painful to find.
๐Ÿ‘ 1
๐Ÿ‘๐Ÿป 1
@jw what gave it away? Was it the stacktrace?
j
Scars of the past!
m
๐Ÿ˜‚
Thank you
Literally spent the past 2 hours on this
@nschulzke if you're curious about the solution
๐Ÿ‘ 1
a
I just answered this in the past thread, and I went hardcore javascrip on it, thanks for letting me the gradle way ๐Ÿ˜