SwiftyMocky icon indicating copy to clipboard operation
SwiftyMocky copied to clipboard

SwiftyMocky is generating AMassiveTestProtocolMock, which is not a protocol in our project

Open rserentill opened this issue 2 years ago • 3 comments

Hello there, We have been using SwiftyMocky for quite some years now and it's been always working wonderfully. However, since today, it is creating mocks for protocols that are not currently in the project.

For example, it is creating a mock for AMassiveTestProtocol by adding a class:

open class AMassiveTestProtocolMock: AMassiveTestProtocol, Mock, StaticMock {
  ...
}

This is not the only mock it's creating, in fact, it has created a lot of them. I found that the protocol AMassiveTestProtocol is inside of the examples folder in the SwiftyMocky package.

Because of this, we are not able to compile tests target because Xcode is complaining about not finding such protocol (Cannot find type 'AMassiveTestProtocol' in scope).

We are generating the mocks from CocoaPods, we've also tried with mint and the outcome is the same.

I'm not sure why is this suddenly happening, we didn't update SwiftyMocky.

Does anyone have an idea of why is this happening?

rserentill avatar Jul 05 '22 15:07 rserentill

@rserentill could you share more details: SwiftyMocky version, Sourcery version, Mockfile (if possible)?

spaluchiewicz avatar Aug 10 '22 21:08 spaluchiewicz

Check the path u specified in mockfile. It seems to scan swifymocky example that contains of AMassiveTestProtocol. So u need exclude swifymocky example path

shurale85 avatar Feb 16 '24 08:02 shurale85