Create Integration & Mocked Unit Tests for the API Methods the Library does cover
fetchCoinList, fetchCurrentPrice, etc.
I'm not super familiar with Haskell myself or else I'd submit a PR already, but after there are a few example tests I'd be happy to try going through and implementing test cases for the uncovered portions of the API
I think the integration tests will just confirm that you do get a 200 OK or whatever is the appropriate response you should get according to the API docs for a successful request. That allows you to track changes to the API in your test framework.
Then also I'm thinking you can't unit test against the API for something like the result of 'fetchCurrentPrice' unless you build a mock that pretends like it's responding with data in the format you'd expect to receive from the API, but for which the return value is known in advance. However, thinking about it, it could be more worthwhile to create those as behavior tests rather than unit tests. idk. Let me know your thoughts on if this kind of testing would even be valuable.
@zenware Thanks for opening this! These are great ideas 😄
Did you see the small test that's there already (Spec.hs)? The part about tracking 200's is what's already there - the tests check the a Right value is returned, which will only happen on a 200. In order to track further API changes, we theoretically should be able to just improve on that test and make it more fined grained.
The mocking responses idea is definitely a good one for just making sure we parse json back correctly, though that doesn't help us with responses we can't anticipate ahead of time. If we add any utilities on top of the bare API wrappers, the mocks will certainly be useful.
Between possibly improving the existing tests and adding others where we mock out the network responses, there's definitely more testing that could be done (A statement that's nearly always true 😄 )
Feel free to open a PR if you're up for it!