所以我在Swift中进行单元测试非常新。在我的项目中,我使用了几个安装在我的可可豆荚中的框架,但是当我要在我的测试文件中编写一些代码时,我总是得到这个错误。 missing module: Firebase, Eureka, ImageRow
我试图在@testable上面导入这些模块,但不知何故它没有识别模块。它继续说module not found
。我还尝试删除inherit search paths
中的我的广告连播,它仍然在询问我是否需要导入这些模块。这是我的可可豆荚。
target 'ProjectRed' do
use_frameworks!
pod 'Firebase'
pod 'Eureka'
pod 'ImageRow'
pod ‘Firebase/Database’
pod ‘Firebase/Storage’
# Pods for ProjectRed
target 'ProjectRedTests' do
inherit! :search_paths
# Pods for testing
end
target 'ProjectRedUITests' do
inherit! :search_paths
# Pods for testing
end
end
答案 0 :(得分:1)
target 'ProjectRedTests' do
inherit! :search_paths
pod 'Firebase'
pod 'Eureka'
pod 'ImageRow'
pod ‘Firebase/Database’
pod ‘Firebase/Storage’
我将这些模块放在ProjectRedTests中。
答案 1 :(得分:0)
您还需要将这些框架添加到测试目标中。
(注意:您可能需要在Link Binary With Libraries之前添加一个Copy Files阶段,以使它们进入正确的位置。)