Introduce expects in common wasm sources actualized in wasmJs and wasmWasi

This commit is contained in:
Ilya Gorbunov
2023-11-04 23:45:35 +01:00
committed by Space Team
parent 943c11d239
commit 6d62119659
6 changed files with 9 additions and 4 deletions
@@ -14,7 +14,7 @@ private external fun d8Arguments(): String
@JsFun("() => (typeof process != 'undefined' && typeof process.argv != 'undefined') ? process.argv.slice(2).join(' ') : ''")
private external fun nodeArguments(): String
internal fun getArguments(): List<String> = (d8Arguments().ifEmpty { nodeArguments() }).split(' ')
internal actual fun getArguments(): List<String> = (d8Arguments().ifEmpty { nodeArguments() }).split(' ')
internal class TeamcityAdapterWithPromiseSupport : TeamcityAdapter() {
private var scheduleNextTaskAfter: Promise<JsAny?>? = null
@@ -20,7 +20,7 @@ internal var currentAdapter: FrameworkAdapter? = null
private fun isJasmine(): Boolean =
js("typeof describe === 'function' && typeof it === 'function'")
internal fun adapter(): FrameworkAdapter {
internal actual fun adapter(): FrameworkAdapter {
val result = currentAdapter ?: if (isJasmine()) JasmineLikeAdapter() else TeamcityAdapterWithPromiseSupport()
currentAdapter = result
return result