Mina Eweida
06/18/2020, 3:18 PMArkadii Ivanov
06/18/2020, 10:51 PMArkadii Ivanov
06/18/2020, 11:05 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 seeMina Eweida
06/19/2020, 9:54 AMMina Eweida
06/19/2020, 10:30 AM@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:Arkadii Ivanov
06/19/2020, 11:13 AM@Test
fun submits_task_to_executor() {
val scheduler = MainScheduler()
val executor = scheduler.newExecutor()
executor.submit {}
}Arkadii Ivanov
06/19/2020, 11:13 AMArkadii Ivanov
06/19/2020, 11:15 AMjsBrowserTest 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)Mina Eweida
06/19/2020, 11:17 AMArkadii Ivanov
06/19/2020, 11:17 AMreaktiveUncaughtErrorHandler
which in JS just prints the error.Arkadii Ivanov
06/19/2020, 11:17 AMMina Eweida
06/19/2020, 11:18 AMMina 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 AMMina Eweida
06/19/2020, 11:21 AMSubmitting 0
[error] ReferenceError: window is not definedMina Eweida
06/19/2020, 11:21 AMArkadii Ivanov
06/19/2020, 1:09 PM