code-corps / code-corps/ember-stripe-service

Cannot test failure modes

Open
#30 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
91
Forks
29
PR merge metrics
No merged PRs in 30d

Description

See emberjs/ember.js#11469

Ember's default `Promise.on('error')` hook causes the current test to fail if it ever encounters a `reject({ anything: "here" })`. Because this library uses `reject` to indicate that the update failed, I can't write a test that asserts that I show an appropriate error message in case of failure.

I think this should be changed in Ember, but if they're going to hold firm, we should probably change it here.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the linked emberjs/ember.js#11469 discussion and the existing tests for rejected updates. Determine whether the Ember Promise.on('error') behavior is resolved upstream; if not, trace this addon's rejection path and update the tests so an appropriate failure message can be asserted without triggering the default error hook.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.