mockery icon indicating copy to clipboard operation
mockery copied to clipboard

Combined inpackage mocks into one file

Open daniel-toye-vt opened this issue 4 years ago • 8 comments

I currently use

mockery -all -inpkg -testonly -case underscore

It generates a mock of every interface in my package for unit test purposes. Some code in the package accepts interfaces defined in the same package so it helps to test.

However, this generates a large amount of mock_.._test.go files. Just wondering if there could be an option to combine all mocks into a single file?

Thanks!

daniel-toye-vt avatar Jul 29 '20 17:07 daniel-toye-vt

I'd say this should be possible, but I don't think I want to introduce it in v2. I'm trying to freeze most new feature requests until the codebase can get into a better/more manageable state (which will be v3).

LandonTClipp avatar Aug 03 '20 16:08 LandonTClipp

waiting for this too :)

aeramu avatar Jan 17 '21 16:01 aeramu

Do we have any news on this topic? This would be extremely helpful 😢

fredw avatar Sep 16 '22 13:09 fredw

Note: this is still on my radar and I do want to support this. The priority now is getting the packages feature into a production-ready state. Once that's done, I can focus my attention on this.

LandonTClipp avatar Apr 06 '23 21:04 LandonTClipp

Assume that this is same issue where we try to generate several interfaces in the same file but as a result it has only one of them. Right?

LightBubblegum avatar Oct 12 '23 17:10 LightBubblegum