mapbox / mapbox/mapbox-gl-directions
Tests should fail more gracefully if access token is not set
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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