Skip to content

Commit baa1b11

Browse files
committed
fix tests run on android
1 parent 042fa28 commit baa1b11

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

javascript/build.gradle.kts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,29 @@
22
* Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
6+
import org.gradle.api.tasks.testing.logging.TestLogEvent
7+
58
plugins {
69
id("multiplatform-library-convention")
710
id("dev.icerock.mobile.multiplatform.android-manifest")
811
id("publication-convention")
912
}
1013

14+
android {
15+
testOptions.unitTests.isIncludeAndroidResources = true
16+
defaultConfig {
17+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18+
}
19+
20+
sourceSets {
21+
getByName("androidTest").java.srcDirs(
22+
file("src/androidAndroidTest/kotlin"),
23+
file("src/mobileDeviceTest/kotlin")
24+
)
25+
}
26+
}
27+
1128
dependencies {
1229
androidMainImplementation(libs.quickjs)
1330
commonMainImplementation(libs.kotlinSerialization)
@@ -20,3 +37,16 @@ dependencies {
2037
androidTestImplementation(libs.testJUnitExt)
2138
androidTestImplementation(libs.testJUnitExtKtx)
2239
}
40+
41+
tasks.withType<AbstractTestTask> {
42+
testLogging {
43+
exceptionFormat = TestExceptionFormat.FULL
44+
events = setOf(
45+
TestLogEvent.SKIPPED,
46+
TestLogEvent.PASSED,
47+
TestLogEvent.FAILED
48+
)
49+
showStandardStreams = true
50+
}
51+
outputs.upToDateWhen { false }
52+
}

0 commit comments

Comments
 (0)