Skip to content
Inertia

Testing

Terminal window
./gradlew :kona-inertia:test :kona-inertia:koverVerify

CI enforces 100% line and branch coverage on production code.

@AfterEach
fun tearDown() {
Inertia.reset()
Vite.reset()
Kona.reset()
}

Drive the kernel:

val app = Kona.create(arrayOf("--base=$temp"))
.providers(HttpServiceProvider(), InertiaServiceProvider())
.boot()
app.resolve(HttpKernel::class.java).pushMiddleware(HandleInertiaRequests())
val response = app.resolve(HttpKernel::class.java).handle(
Request("GET", "/", headers = mapOf("X-Inertia" to "true")),
)

:inertia-sample-kotlin:test and :inertia-sample-java:test exercise HTML + JSON visits with shared props.