Hi, Anyone able to share test util classes across ...
# multiplatform
a
Hi, Anyone able to share test util classes across Multiplatform Modules? I have a Test Interface that has different implementation depending on whether it is accessed in
iosTest
,
androidUnitTest
,
androidInstrumtedTest
. I want to share this across multiple module but I can’t seem to figure out how. My original thought was to create a normal KMP module. and just do
Copy code
// other module
commonTest.dependencies {
    implementation(":myShared:TestModule")
}
I could define the
iosTest
implementation in
iosMain
but I don’t know how to specify
androidUnitTest
and
androidUnitTest
in this way. Any suggestion?
m
Unfortunately both
androidUnitTest
and
androidInstrumentedTest
would pull in
androidMain
. You could create another module for one of the Android places and then change which project is being depended on.
👍 1