Skip to content

How to add mocks for internal packages using configuration? #664

Closed Answered by LandonTClipp
flymop asked this question in Q&A
Discussion options

You must be logged in to vote

Because you can utilize go templating in the dir variable, you can use one of our provided template functions to replace the name of "internal" to something else. It might be something like (untested):

dir: mocks/{{ replaceAll .PackagePath "internal" "internal_" }}

You're also free to generate your mocks next to the interface: https://vektra.github.io/mockery/latest/features/#layouts

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@flymop
Comment options

Answer selected by flymop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants