Hello folks, how are you separating unit tests fro...
# multiplatform
a
Hello folks, how are you separating unit tests from integration test in a multiplatform setting??
a
I never inject multiplatform settings directly to my consumers.. instead i pass a interface. And for unit tests they depend on a fake in memory data impl, for android and other platform tests the impl with settings instance is used
a
I am sorry, I failed to make myself clear. When I said "In a multiplatform setting", I meant "In a multiplatform project", Not Russel Wolf's library "Multiplatform Settings"
Screenshot 2023-10-01 at 1.08.53 PM.png
a
and where do integration tests (not unit tests) for browser go? where do intergration tests for desktop go?? In short i am almost asking for the equivalent of "androidInstrumentedTest" (androidIntergrationTest to be precise) but for non android targets such as, browser, nodejs, desktop, all other nativeTargets.
on top of that, I am asking how do I place them in a single source set? (say commonIntegration test)???
the same way android test have been split for unit and instrumentation tests, I need to be able to split unit tests and integration tests for all targets
a
You can create your own source sets right and name them ?
Copy code
val jvmIntegrationTest by creating {}
        val jvmTest by getting {
            dependsOn(jvmIntegrationTest)
        }
        val nativeIntegrationTest by creating {}
        val nativeTest by getting {
            dependsOn(nativeIntegrationTest)
        }
a
and what gradle task will I execute so that I may only run those tests in those sourceSets??
a
how about filtering by package ?
Copy code
gradle test --tests 'com.example.native.integrationTests*'