AkshatM / caprice

A Go client for RANDOM.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduce mocks in our testing

AkshatM opened this issue · comments

Currently, all of our tests are raw network calls that only ensure valid responses are received.This requires having a valid API key at all times (which isn't recommended), and it tests something we have no control over, namely what the API returns.

We want to improve how we test Caprice by mocking out network calls to an endpoint with an HTTP mocker, and validating error paths in the flow by deliberately returning malformed data.

This ensures better test coverage overall and can help us catch errors more effectively.