michael-siek / michael-siek/coingecko-api

tests: we should not hit the live endpoint for our tests, we should mock them

Open
#40 0 comments 0 reactions 0 assignees View on GitHub
good first issue help wanted tech debt
Dominant language
TypeScript
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

As we keep on adding more and more tests, we shouldn't really hit the live CG endpoints for our tests.

We should utilise [nock](https://github.com/nock/nock) and mock the response we expect from the endpoint(s).

This has one limitation, that being if the endpoint changes (structure and/or properties added/removed) the mocked shape will no longer be accurate

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the tests that call the live CoinGecko endpoints and inspect how the project currently configures its test suite. Use nock to mock the expected endpoint responses, then verify that the tests pass without contacting the live API.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
api, testing-qa
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.