jamesplease / jamesplease/backbone.premium-router
Test the promise being rejected due to an error
- Dominant language
- JavaScript
- Stars
- 7
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
[These](https://gist.github.com/jmeas/2aefd32c4032293e39b5) are (roughly) the tests.
I was unable to do this because mocha flips out when the `fetch` method throws an error. If anyone knows a way to test [this code path](https://github.com/jmeas/backbone.object-router/blob/d056160b96d44e80fdb69b575e02c08efb226ffb/src/router.js#L49-L52) – let me know!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/router.js lines 49-52 and compare the expected cases in the linked gist. Reproduce the Mocha failure when fetch throws, then add a test covering the rejected promise; done means the error path is exercised without Mocha failing unexpectedly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100