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

Mocking the client #2018

Open
jaredallard opened this issue Sep 25, 2024 · 2 comments
Open

Mocking the client #2018

jaredallard opened this issue Sep 25, 2024 · 2 comments

Comments

@jaredallard
Copy link
Contributor

Hey! I wanted to ask what the recommended way is for mocking this library or plans for doing so. Because we're using struct fields on client, there doesn't seem to be any easy way to mock the client without using our own transport, which is pretty tedious for tests.

I ended up taking a code generated approach of mocking each Service struct in my library here, by modifying them to be accessed over functions: https://github.com/jaredallard/gitlab. However, I don't think it's super tenable/great for me to manage this longer term, so I'd love to understand what's been thought about before and for the future!

Also, huge kudos/props for all of your work on this ❤️

@svanharmelen
Copy link
Member

Thanks @jaredallard but I don't have a clear vision and/or any plans for supporting mocking at the moment, as I'm super busy and already struggling to keep this package up-to-date as it is 😏

@jaredallard
Copy link
Contributor Author

No worries whatsoever. Happy to keep maintaining this on the side until there's more bandwidth! As I'm using this more and more I'll be sure to try to knock out things where I can to help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants