-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot test failure modes #30
Comments
In the meantime, one solution that @iezer came up with was to wrap the result in if (response.error) {
Ember.run(null, reject, new Ember.Error(response.code));
} Edit: this does not work. We had something else disguising the problem. |
@jamesarosen ah, I remember this well. I think I opened the issue in What's your proposed solution for this right now? It's been over a year since my head was wrapped around that problem and haven't encountered it since. Meanwhile, it looks like you may have made significant progress in your understanding of the problem/solution based on that thread. |
The fallout of that Ember issue was that the core team added some tests to ensure that a rejected promise doesn't fail the tests, but an uncaught rejected promise does. So the application code should somehow account for the possible rejection. |
See emberjs/ember.js#11469
Ember's default
Promise.on('error')
hook causes the current test to fail if it ever encounters areject({ anything: "here" })
. Because this library usesreject
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.
The text was updated successfully, but these errors were encountered: