Handle unhandled promise rejections #706
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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