I understand that `testApplication` is supposed to...
# ktor
j
I understand that
testApplication
is supposed to load
application.conf
by default? At least, according to the docs. I’m using CIO (not embeddedServer) and it doesn’t seem to be working. Does not work
Copy code
@Test
fun testRoot() = testApplication {
    client.get("/").apply {
        assertEquals(HttpStatusCode.OK, status)
        assertEquals("Hello World!", bodyAsText())
    }
}
Works
Copy code
@Test
fun testRoot() = testApplication {
    environment {
        config = HoconApplicationConfig(ConfigFactory.load())
    }
    client.get("/").apply {
        assertEquals(HttpStatusCode.OK, status)
        assertEquals("Hello World!", bodyAsText())
    }
}
a
What version of Ktor do you use?
j
The V3 preview
a
Since Ktor 3.0.0-beta-2, the configuration in the tests isn't loaded automatically (https://youtrack.jetbrains.com/issue/KTOR-7043).
j
ah, thank you!