Mock a protocol in an SPM dependency framework.
Konskii opened this issue · 0 comments
We decided to move from Pods to SPM in new project, but when writing tests and generating mocks we noticed that swiftyMocky can't properly generate mocks for our protocols that inherited from dependency protocols.
When we were using Pods we just declared sources path for that dependency in configuration file and all worked perfect.
But when using SPM we can't declare path to SPM checkouts, because it's random generated for every machine and looks like this:
~/Library/Developer/Xcode/DerivedData/my-project-name-gcspsuvvozzxfvcfuobdvkxhegra/SourcePackages/checkouts
We can't declare this path in Mockfile because:
- It's random generated
- SwiftyMocky appends root for all source paths that we declare.
So, how can we generate mocks for protocols that inherited from spm dependency protocols without copying dependency sources to project directly?