File tree Expand file tree Collapse file tree 6 files changed +11
-1
lines changed
kotlinx-coroutines-test/wasmJs/test Expand file tree Collapse file tree 6 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ import kotlin.test.*
1010
1111class MainDispatcherTest : MainDispatcherTestBase .WithRealTimeDelay () {
1212
13+ @OptIn(ExperimentalForeignApi ::class )
1314 override fun isMainThread (): Boolean = CFRunLoopGetCurrent () == CFRunLoopGetMain ()
1415
1516 // skip if already on the main thread, run blocking doesn't really work well with that
1617 override fun shouldSkipTesting (): Boolean = isMainThread()
1718
19+ @OptIn(BetaInteropApi ::class )
1820 override fun scheduleOnMainQueue (block : () -> Unit ) {
1921 autoreleasepool {
2022 dispatch_async(dispatch_get_main_queue()) {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import kotlinx.coroutines.testing.*
44import kotlin.js.*
55import kotlin.test.*
66
7+ @OptIn(ExperimentalWasmJsInterop ::class )
78class PromiseTest : TestBase () {
89 @Test
910 fun testPromiseResolvedAsDeferred () = GlobalScope .promise {
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ class PropagateExceptionFinalResortTest : TestBase() {
3030 }
3131}
3232
33+ @OptIn(ExperimentalWasmJsInterop ::class )
3334private fun addUncaughtExceptionHandlerHelper () {
3435 js("""
3536 globalThis.exceptionCaught = false;
@@ -40,10 +41,12 @@ private fun addUncaughtExceptionHandlerHelper() {
4041 """ )
4142}
4243
44+ @OptIn(ExperimentalWasmJsInterop ::class )
4345private fun removeHandlerHelper () {
4446 js("""
4547 process.removeListener('uncaughtException', globalThis.exceptionHandler);
4648 """ )
4749}
4850
51+ @OptIn(ExperimentalWasmJsInterop ::class )
4952private fun exceptionCaught (): Boolean = js(" globalThis.exceptionCaught" )
Original file line number Diff line number Diff line change 11package kotlinx.coroutines.test
22
3+ @OptIn(ExperimentalWasmJsInterop ::class )
34actual fun testResultChain (block : () -> TestResult , after : (Result <Unit >) -> TestResult ): TestResult =
45 block().then(
56 {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import kotlinx.coroutines.*
44import kotlin.test.*
55
66class PromiseTest {
7+ @OptIn(ExperimentalWasmJsInterop ::class )
78 @Test
89 fun testCompletionFromPromise () = runTest {
910 var promiseEntered = false
@@ -15,4 +16,4 @@ class PromiseTest {
1516 p.await<JsAny >()
1617 assertTrue(promiseEntered)
1718 }
18- }
19+ }
Original file line number Diff line number Diff line change 1+ @file:OptIn(ExperimentalWasmJsInterop ::class )
2+
13package kotlinx.coroutines.testing
24
35import kotlin.test.*
You can’t perform that action at this time.
0 commit comments