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

Implement validateErrorHandler utility. #247

Merged
merged 1 commit into from Nov 28, 2017

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Nov 28, 2017

Ensures that Ember.onerror is setup that properly re-throws when testing.

This is intended to be used by test framework hosts (or other libraries) to ensure that Ember.onerror is properly configured. Without a check like this, Ember.onerror could easily swallow all errors and make it seem like everything is just fine (and have green tests) when in reality everything is on fire...

Example implementation for ember-qunit:

import { validateErrorHandler } from '@ember/test-helpers';

test('Ember.onerror is functioning properly', function(assert) {
  let result = validateErrorHandler();
  assert.ok(result.isValid, result.message);
});

Additional reading:

Ensures that `Ember.onerror` is setup that properly re-throws when
testing.

This is intended to be used by test framework hosts (or other libraries)
to ensure that `Ember.onerror` is properly configured. Without a check
like this, `Ember.onerror` could _easily_ swallow all errors and make it
_seem_ like everything is just fine (and have green tests) when in
reality everything is on fire...

Example implementation for `ember-qunit`:

```js
import { validateErrorHandler } from '@ember/test-helpers';

test('Ember.onerror is functioning properly', function(assert) {
  let result = validateErrorHandler();
  assert.ok(result.isValid, result.message);
});
```
@rwjblue rwjblue merged commit de605ca into emberjs:master Nov 28, 2017
@rwjblue rwjblue deleted the validate-error-handler branch November 28, 2017 23:35
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

1 participant