Hi, I'm getting a `Instance creation error : could...
# koin
m
Hi, I'm getting a
Instance creation error : could not create instance for [Single:'<http://class.that.should.be|class.that.should.be>.injected.ClassName']: java.lang.IllegalStateException: No Koin Context configured. Please use startKoin or koinApplication DSL.
when using checkModules like this :
Copy code
@Category(CheckModuleTest::class)
class ModuleCheck : AutoCloseKoinTest() {
    val config = ...
    val rules = ...
    @Test
    fun checkEpilinkModules() {
        with(ClassThatProvidesModules(config, rules)) {
            checkModules {
                modules(moduleOne, moduleTwo, moduleTwo)
            }
        }
    }
}
and launching the class with IntelliJ IDEA or
gradle test
. Any ideas?
a
You do need to
startKoin
in test as well. You can wrap your
checkModules
call inside
startKoin { checkModules{ ... } }
and it should do the trick
m
checkKoin does not seem to exist 🤔
a
Yes, sure… I miss typed it 😅