Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants