diff --git a/gradle.properties b/gradle.properties index 967fec25f..004fca198 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,3 +8,5 @@ org.gradle.caching=true android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true + +kotlin.js.compiler=both diff --git a/includedBuild/gradleConfiguration/src/main/kotlin/com/badoo/reaktive/configuration/JsPlugin.kt b/includedBuild/gradleConfiguration/src/main/kotlin/com/badoo/reaktive/configuration/JsPlugin.kt index 0b31c93ea..75398e644 100644 --- a/includedBuild/gradleConfiguration/src/main/kotlin/com/badoo/reaktive/configuration/JsPlugin.kt +++ b/includedBuild/gradleConfiguration/src/main/kotlin/com/badoo/reaktive/configuration/JsPlugin.kt @@ -5,9 +5,7 @@ import com.badoo.reaktive.dependencies.Deps import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.tasks.SourceSet -import org.jetbrains.kotlin.gradle.dsl.KotlinJsOptions import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension -import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile @Suppress("UnstableApiUsage") class JsPlugin : Plugin { @@ -46,26 +44,9 @@ class JsPlugin : Plugin { } } } - target.tasks.named(TASK_COMPILE_KOTLIN_JS, Kotlin2JsCompile::class.java) { - kotlinOptions.configure() - } - target.tasks.named(TASK_COMPILE_KOTLIN_JS_TEST, Kotlin2JsCompile::class.java) { - kotlinOptions.configure() - } - } - - private fun KotlinJsOptions.configure() { - metaInfo = true - sourceMap = true - sourceMapEmbedSources = "always" - moduleKind = "umd" - main = "call" } companion object { - private const val TASK_COMPILE_KOTLIN_JS = "compileKotlinJs" - private const val TASK_COMPILE_KOTLIN_JS_TEST = "compileTestKotlinJs" - const val TARGET_NAME_JS = "js" } } diff --git a/reaktive-testing/src/commonMain/kotlin/com/badoo/reaktive/test/single/TestAwait.kt b/reaktive-testing/src/commonMain/kotlin/com/badoo/reaktive/test/single/TestAwait.kt index c0d0c36ab..88533eb54 100644 --- a/reaktive-testing/src/commonMain/kotlin/com/badoo/reaktive/test/single/TestAwait.kt +++ b/reaktive-testing/src/commonMain/kotlin/com/badoo/reaktive/test/single/TestAwait.kt @@ -50,4 +50,4 @@ import com.badoo.reaktive.single.Single * @param assertSuccess when provided, it will be called in case of [Single] success. * This gives an opportunity to assert the result. */ -expect fun Single.testAwait(assertError: ((Throwable) -> Unit)? = null, assertSuccess: (T) -> Unit = {}) +expect fun Single.testAwait(assertError: ((Throwable) -> Unit)? = null, assertSuccess: (T) -> Unit) diff --git a/reaktive-testing/src/commonTest/kotlin/com/badoo/reaktive/test/single/TestAwaitTest.kt b/reaktive-testing/src/commonTest/kotlin/com/badoo/reaktive/test/single/TestAwaitTest.kt index 0c1eb00f0..52040e97e 100644 --- a/reaktive-testing/src/commonTest/kotlin/com/badoo/reaktive/test/single/TestAwaitTest.kt +++ b/reaktive-testing/src/commonTest/kotlin/com/badoo/reaktive/test/single/TestAwaitTest.kt @@ -9,9 +9,9 @@ import kotlin.test.assertSame class TestAwaitTest { @Test - fun succeeds_WHEN_upstream_succeeded_and_no_assertSuccess() = + fun succeeds_WHEN_upstream_succeeded_and_empty_assertSuccess() = singleOf(1) - .testAwait() + .testAwait(assertSuccess = {}) @Test fun succeeds_WHEN_upstream_succeeded_and_assertSuccess_did_not_throw() = @@ -23,6 +23,6 @@ class TestAwaitTest { val error = Exception() return singleOfError(error) - .testAwait(assertError = { assertSame(error, it) }) + .testAwait(assertError = { assertSame(error, it) }, assertSuccess = {}) } }