mapbox / mapbox/mapbox-gl-directions

Tests should fail more gracefully if access token is not set

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

Nobody has claimed this yet.

good first issue
Dominant language
JavaScript
Stars
255
Forks
130
PR merge metrics
No merged PRs in 30d

Description

When you run `npm test` without setting the your access token in your local environment, you get the following error:

```
# directions
# initialized
ok 1 directions is initialized
# set/get inputs
not ok - Uncaught, unspecified "error" event. ([object Object])
http://localhost:58414/script.js:2069
var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
```

It should instead tell you that you're missing your access token.

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 running npm test without an access token and inspect the failure reported at script.js:2069, then trace it back to the test setup that reads the token. The work is done when this missing configuration produces a clear message stating that the access token is required instead of the unspecified error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authentication, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.