Skip to content
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

Feature - adds setupOnerror function to allow patching Ember.onerror in tests #540

Merged
merged 1 commit into from Jan 26, 2019

Conversation

scalvert
Copy link
Contributor

@scalvert scalvert commented Jan 24, 2019

It's fairly common to want to temporarily set an Ember.onerror handler to test specific aspects of error handling within your application. Newer versions of sinon do not make this easy, as the Ember.onerror object is a defined property, and sinon has a codepath that excludes stubbing this particular method (it's a bit weird to stub it anyway, isn't it?).

This PR introduces a utility to setup Ember.onerror, and ensures that it's reset to its original state when the test context is torn down.

TODO:

  • Write tests

@scalvert scalvert changed the title [WIP] - Feature - adds setupEmberOnerror function to allow patching Ember.onerror in tests Feature - adds setupEmberOnerror function to allow patching Ember.onerror in tests Jan 25, 2019
@scalvert scalvert changed the title Feature - adds setupEmberOnerror function to allow patching Ember.onerror in tests Feature - adds setupOnerror function to allow patching Ember.onerror in tests Jan 25, 2019
@rwjblue rwjblue merged commit 57cf105 into emberjs:master Jan 26, 2019
@scalvert scalvert deleted the setup-ember-onerror branch January 27, 2019 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants