withApplication

fun <R> withApplication(environment: <ERROR CLASS> = createTestEnvironment(), configure: TestApplicationEngine.Configuration.() -> Unit = {}, test: TestApplicationEngine.() -> R): R

Starts a test application engine, passes it to the test function, and stops it.