Hi guys, I'm using `Ktor` and I'm trying to inject...
# koin
o
Hi guys, I'm using
Ktor
and I'm trying to inject into a
Test
a class that is scoped to a Ktor`Request`. If I switch the
Scope
annotations with
Factory
, Everything is working perfectly and Koin figures out the dependency graph. I'm not using Ktor's
testApplication
because while these classes are indeed scoped to a Ktor Request, they aren't really related to Ktor and I just generally need to test their logic. ("They just happen to be scoped") Is it possible to do so?
Copy code
class SomeClass {

    operator fun invoke(someInt: Int) {

    }
}

class Test : KoinTest {

    private val someClass: SomeClass by inject()

    @JvmField
    @RegisterExtension
    val koinTestExtension = KoinTestExtension.create {
        modules(defaultModule)
    }

    @Test
    fun a() = runBlocking {
        someClass(1)
        assertTrue(true)
    }
}
a
problem is that yoru scope is created from a Ktor request. Are you creating it by hand?