Mina Eweida
06/18/2020, 3:18 PMArkadii Ivanov
06/18/2020, 10:51 PMMina Eweida
06/19/2020, 9:53 AMMainScheduler
was running on a test, so I will just try to run a test using it and see if it crashes then will run it with my change and see@Test
fun test_main_scheduler_subscription() {
val emitted = 10
val upstream = observable<Int> {
it.onNext(emitted)
}.subscribeOn(mainScheduler)
upstream.subscribe {
assertEquals(emitted, it)
}
}
This tests works fine with both globalThis
and window
when running jsNodeTest
😞Arkadii Ivanov
06/19/2020, 11:13 AMReferenceError
in current master:@Test
fun submits_task_to_executor() {
val scheduler = MainScheduler()
val executor = scheduler.newExecutor()
executor.submit {}
}
jsBrowserTest
task passes but the jsNodeTest
failsMina Eweida
06/19/2020, 11:15 AMmainScheduler
and subscription actually called submit
in the mainScheduler
and I was able to see it (I printed inside submit)Arkadii Ivanov
06/19/2020, 11:17 AMreaktiveUncaughtErrorHandler
which in JS just prints the error.Mina Eweida
06/19/2020, 11:18 AMArkadii Ivanov
06/19/2020, 11:20 AMreaktiveUncaughtErrorHandler
. The susbcribe{}
was never called and so test passed.Mina Eweida
06/19/2020, 11:21 AMSubmitting 0
[error] ReferenceError: window is not defined
Arkadii Ivanov
06/19/2020, 1:09 PM