Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save john-kurkowski/da3abb95329f14f19c19 to your computer and use it in GitHub Desktop.
Save john-kurkowski/da3abb95329f14f19c19 to your computer and use it in GitHub Desktop.
My answer to "How to test Ember error substate, with Ember CLI test runner?" http://stackoverflow.com/q/34074386/62269
import Ember from 'ember';
import moduleForAcceptance from '../helpers/module-for-acceptance';
import sinon from 'sinon';
const { Test } = Ember;
moduleForAcceptance('Acceptance | error', {
beforeEach() {
this.sandbox = sinon.sandbox.create();
// Override Ember.Test's default failure on uncaught errors. See http://stackoverflow.com/a/34138273/62269
this.sandbox.stub(Test.adapter, 'exception');
},
afterEach() {
this.sandbox.restore();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment