can i use the test host directly without using `wi...
# ktor
c
can i use the test host directly without using
withTestApplication
?
i have unit tests that spin up ktor on a random port and send request to it, and i want to convert them to use the test host for performance reasons
something like
Copy code
val testApplication = ...
testApplication.handleRequest(...)
testApplication.close()
m
AFAIK the point of the test infrastructure is to not open a port etc.
c
exactly. and i already got it working
Copy code
val te = TestApplicationEngine(environment = createTestEnvironment {
                module(Application::main)
            }) {}.apply { start() }

            te.handleRequest(...)
            te.stop(0, 0, TimeUnit.MILLISECONDS)