Chukwukammadu Anizoba
09/15/2021, 9:27 AMpromise
keyword doesn't exist in Kotlin/JS alone.Big Chungus
09/15/2021, 10:00 AMChukwukammadu Anizoba
09/15/2021, 10:05 AMChukwukammadu Anizoba
09/17/2021, 7:18 AMGlobalScope.promise
extension function:
@BeforeTest
fun setup() {
testPromise = Promise { resolve, _ ->
resolve("Test done!")
}
}
@Test
fun test_name() = GlobalScope.promise {
//Test body
sut.performActionWithCoroutine()
testPromise.await() <-- Get the result of the coroutine here
//Assertions
}