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

Mocking the client #2018

@jaredallard

Description

@jaredallard

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 ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions