且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

KoinAppAlreadyStartedException:Koin应用程序已经启动

更新时间:2022-02-25 22:16:26

作为@After方法的替代方法,您也可以使用AutoCloseKoinTest.

As an alternative to the @After approach, you can also use AutoCloseKoinTest. As described in the docs:

扩展的Koin测试-嵌入自动关闭@after方法以在每次测试后关闭Koin

Extended Koin Test - embed autoclose @after method to close Koin after every test

您可以扩展AutoCloseKoinTest而不是扩展KoinTest,它将为您做事后测试.

Instead of extending KoinTest, you can extend AutoCloseKoinTest and it will do the after test for you.