Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock a protocol in an SPM dependency framework. #339

Open
Konskii opened this issue Feb 1, 2023 · 0 comments
Open

Mock a protocol in an SPM dependency framework. #339

Konskii opened this issue Feb 1, 2023 · 0 comments

Comments

@Konskii
Copy link

Konskii commented Feb 1, 2023

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:

  1. It's random generated
  2. 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant