I followed these steps:
Swift Package Manager
In Xcode, navigate in menu: File > Swift Packages > Add Package Dependency
Add https://github.com/Brightify/Cuckoo.git
For the Dependency Rule, Select "Up to Next Major" with 1.10.3. Click Add Package.
On the 'Choose Package Products for Cuckoo' dialog, under 'Add to Target', please ensure you select your Test target as it will not compile on the app target.
Click Add Package.
When you're all set, use the same Run script phase as above and replace
this is my test case code
func test_ScreenVM_isShowPopup_shouldTrue(){
var vm = HomeScreenVM()
let mockAPIService = MockAPIService()
XCTAssertTrue(vm.isShowPopup)
}
The steps require you to replace the line "${PODS_ROOT}/Cuckoo/run", so it's redundant in the run script build phase. Does the error still occur when you remove it?
I followed these steps: Swift Package Manager In Xcode, navigate in menu: File > Swift Packages > Add Package Dependency Add https://github.com/Brightify/Cuckoo.git For the Dependency Rule, Select "Up to Next Major" with 1.10.3. Click Add Package. On the 'Choose Package Products for Cuckoo' dialog, under 'Add to Target', please ensure you select your Test target as it will not compile on the app target. Click Add Package. When you're all set, use the same Run script phase as above and replace
"${PODS_ROOT}/Cuckoo/run" with
"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/Cuckoo/run"
I can import the Cuckoo framework
but when i try to create mockobject using Mock prefix i get "Cannot find 'MockAPIService' in scope" error.
this my sample code class HomeScreenVM { var apiService: APIService = APIService() override init() { super.init() apiService.getStatus() } }
class APIService { func getStatus() -> Bool{ return true } }
this is my test case code func test_ScreenVM_isShowPopup_shouldTrue(){ var vm = HomeScreenVM() let mockAPIService = MockAPIService() XCTAssertTrue(vm.isShowPopup) }