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

Add support to export the mock struct #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

wvell
Copy link

@wvell wvell commented Sep 29, 2023

This adds support to export the mock struct to use the mock in another package.

This type pineappleMock struct{ mock.Mock } becomes this type PineappleMock struct{ mock.Mock }

The following generic data type was not parsed correctly:

    type Subscription[T any] struct {
	c chan T
    }

This was used in the following mocked interface:

    type Test interface {
        GetSubscription() *Subscription[SomeType]
    }

SubscribeUpdate(c chan CollectionEvent) *event.Subscription[CollectionEvent]
@ldez ldez self-requested a review October 3, 2023 15:58
@mloiseleur mloiseleur added the kind/enhancement a new or improved feature. label Feb 20, 2024
@jspdown
Copy link
Contributor

jspdown commented Oct 10, 2024

Hello @wvell.

Could you describe you use case for this? Why do you want to share mocks between packages?

@wvell
Copy link
Author

wvell commented Oct 21, 2024

Well that use case is not needed anymore. The parsing of generics is still relevant though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement a new or improved feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants