You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our project, we use a codegen https://github.com/deepmap/oapi-codegen to generate client under a path ./codegen and this path is ignored in .gitignore (for obvious reason - the code is generated on the fly per build)
The codegen automatiically creates a ClientInterface interface, e.g.
// The interface specification for the client above.typeClientInterfaceinterface {
// SubscribeActionWS requestSubscribeActionWS(ctx context.Context, sourceIdSourceID, params*SubscribeActionWSParams, reqEditors...RequestEditorFn) (*http.Response, error)
// TriggerAction request with any bodyTriggerActionWithBody(ctx context.Context, sourceIdSourceID, nameActionName, contentTypestring, body io.Reader, reqEditors...RequestEditorFn) (*http.Response, error)
TriggerAction(ctx context.Context, sourceIdSourceID, nameActionName, bodyTriggerActionJSONRequestBody, reqEditors...RequestEditorFn) (*http.Response, error)
// GetActionTypes requestGetActionTypes(ctx context.Context, reqEditors...RequestEditorFn) (*http.Response, error)
// RegisterActionTypes request with any bodyRegisterActionTypesWithBody(ctx context.Context, contentTypestring, body io.Reader, reqEditors...RequestEditorFn) (*http.Response, error)
RegisterActionTypes(ctx context.Context, bodyRegisterActionTypesJSONRequestBody, reqEditors...RequestEditorFn) (*http.Response, error)
Because ./codegen is ignored, to use mocktail we will have to inconveniently create a mock_test.go as part of the build process before calling mocktail.
It'd be nice to allow passing ClientInterface (together with package name/path) via mocktail arguments. E.g.
mocktail --interface ./codegen#ClientInterface
The text was updated successfully, but these errors were encountered:
kevinpollet
changed the title
[feature request] allow specifying interfaces to be mocked via mocktail argument (vs mock_test.go)
Allow specifying interfaces to be mocked via mocktail argument (vs mock_test.go)
Oct 10, 2024
In our project, we use a codegen https://github.com/deepmap/oapi-codegen to generate client under a path
./codegen
and this path is ignored in.gitignore
(for obvious reason - the code is generated on the fly per build)The codegen automatiically creates a
ClientInterface
interface, e.g.Because
./codegen
is ignored, to usemocktail
we will have to inconveniently create amock_test.go
as part of the build process before callingmocktail
.It'd be nice to allow passing
ClientInterface
(together with package name/path) viamocktail
arguments. E.g.The text was updated successfully, but these errors were encountered: