Swift TyphoonBlockComponentFactory Error in XCTest

人走茶凉 提交于 2019-11-29 14:19:27

For the benefit of other users:

As discussed over on Typhoon's Github, this error occurs when the Typhoon CocoaPod is included in both the app target as well as the test target.

As application-style tests (with TEST_HOST flag set) are now the default almost everywhere, the test target automatically inherits dependencies from the main app target. In the case of Swift, with name-spacing, things can break if they're duplicated in the test target.

Therefore the solution is to remove Typhoon, and any other of the app's dependencies from the test target as these are inherited. You can still include test-specific dependencies as follows:

target :tests, :exclusive => true do
   pod 'OCMockito'
   pod 'AnotherTestLibrary' #etc . . 
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!