test(connector): add test for Koin modules

This commit is contained in:
Anthony 2024-04-04 22:09:34 +02:00
parent 8b0ca76ed2
commit 78c8d73774
2 changed files with 46 additions and 0 deletions

View File

@ -12,6 +12,9 @@ val kotlinxVersion = "1.8.0"
val koinVersion = "3.5.3" val koinVersion = "3.5.3"
val kodeinVersion = "7.21.2" val kodeinVersion = "7.21.2"
// Testing Versions
val jupyterVersion = "5.10.1"
kotlin { kotlin {
jvm("desktop") jvm("desktop")
jvmToolchain(21) jvmToolchain(21)
@ -60,6 +63,24 @@ kotlin {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:$kotlinxVersion") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:$kotlinxVersion")
} }
// Testing
val desktopTest by getting
commonTest.dependencies {
implementation(kotlin("test"))
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.uiTest)
implementation("org.junit.jupiter:junit-jupiter:$jupyterVersion")
}
desktopTest.dependencies {
implementation(compose.desktop.uiTestJUnit4)
implementation(compose.desktop.currentOs)
implementation("org.junit.jupiter:junit-jupiter:$jupyterVersion")
implementation("io.insert-koin:koin-test:$koinVersion")
}
} }
} }

View File

@ -0,0 +1,25 @@
package di
import org.koin.dsl.koinApplication
import org.koin.test.KoinTest
import org.koin.test.check.checkModules
import kotlin.test.Test
class CheckKoinModulesTest : KoinTest {
/**
* Launches and runs all modules.
*
* See [Koin Docs](https://insert-koin.io/docs/reference/koin-test/checkmodules) on more information
*/
@Test
fun verifyKoinApp() {
koinApplication {
modules(
commonModule(),
viewModelModule()
)
checkModules()
}
}
}