mapbox / mapbox/mapbox-gl-geocoder

Mock geocoding calls in tests

Open
#225 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged enhancement
Dominant language
JavaScript
Stars
388
Forks
181
PR merge metrics
No merged PRs in 30d

Description

We currently make live http calls to the geocoding service during the automated testing. We should probably mock these calls so that we do not need to make live requests during development. This would also means that setting up a test environment would be one step easier because no access token would be required to run tests.

\cc @katydecorah @yuletide

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the automated tests that make live HTTP requests to the geocoding service and identify how the access token is read. Replace those live calls with mocks while preserving the test scenarios; done means the test suite makes no live geocoding requests and runs without a Mapbox access token.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.