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

Properly report exceptions #59

Merged
merged 1 commit into from
Feb 15, 2017

Conversation

trentmwillis
Copy link
Member

Since axe-core switched to using Promises internally, the exceptions during auto-run were getting swallowed. There is no correct way to hook into the Testing Promise system Ember uses, so we instead simply catch any errors and report them through the test adapter.

This will fix #47.

return axe.run('#ember-testing-container', axe.ember.testOptions)
.then(axe.ember.a11yCheckCallback)
.catch(Ember.Test.adapter.exception)
.then(() => runningAudit = false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a finally

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

axe-core only uses ES6 Promises, which don't have .finally (yet, it's in proposal)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! Thanks for double checking.

@trentmwillis
Copy link
Member Author

@ember-a11y/core, would appreciate another review. This should be the last one before releasing v0.2.0, which will hopefully make it much easier for folks to adopt (since it's more stable and has the on-demand a11yAudit helper).

@trentmwillis
Copy link
Member Author

Updated an existing test to verify the exception reporting behavior. Merging this now...

@trentmwillis trentmwillis merged commit c8b42b5 into ember-a11y:master Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests do not fail on a11y violations
4 participants