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

Handle unhandled promise rejections #706

Merged
merged 1 commit into from
Jun 12, 2020
Merged

Conversation

darreneng
Copy link
Contributor

Our accessibility tests need to be run asynchronously because of axe-core:
https://github.com/appfolio/react-gears/blob/740ec87fd5ec923f3b134672723eae67c18986b8/test/a11yHelpers.js

Unfortunately, if our code fails an assertion or throws an error inside of a promise, mocha will only print the error to the screen but the tests won't actually fail. This is a long-standing issue with mocha.

mochajs/mocha#2640

In the future mocha might handle this automatically for us, but for now we need this workaround for async tests.

This was copied from property app (thanks @mathewbaltes !)
https://github.com/appfolio/apm_bundle/blob/b803535c547c0759176503b8190aa12b972afe9e/apps/property/helpers.js#L49-L63

@gthomas-appfolio gthomas-appfolio merged commit b24d824 into master Jun 12, 2020
@gthomas-appfolio gthomas-appfolio deleted the deUnhandledRejection branch June 12, 2020 23:03
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.

3 participants