We’re using Pretender with QUnit tests with ember-cli.
Specifically, we want to check whether an action displays an error message in an error dialog on the page for some request.
We set Pretender to answer the request with status code 409 and that is working fine.
Alas, the test fails prematurely with two extra assertions having failed:
1. Error: Conflict@ 316 ms Expected: true Result: false Diff: true false 2. TypeError: cyclic object value@ 319 ms Expected: true Result: false Diff: true false
The cause seems to be that Ember itself handles the failing AJAX promise spitting out these errors when in “testing” mode.
RSVP.off('error', Ember.RSVP.onerrorDefault); at the beginning of the test case disables this behaviour, but that function is not even documented and it feels a bit awkward.
Is there a better way to handle this scenario? How do you let the errors just pass through to the application?