aviaviavi / aviaviavi/cryptocompare

Create Integration & Mocked Unit Tests for the API Methods the Library does cover

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
79
Forks
4
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inventorying the covered API methods named in the issue, including fetchCoinList and fetchCurrentPrice, and read the API documentation for their successful responses. Review the existing Haskell test setup, if present, before deciding how integration and mocked behavior tests should be structured. Done means the agreed covered methods have tests for successful API responses and known mock results.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
api, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.