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

Fix for unhandled promise rejections in Jest tests #80

Merged
merged 1 commit into from
Nov 27, 2017

Conversation

mpeyper
Copy link
Contributor

@mpeyper mpeyper commented Nov 3, 2017

Firstly, thanks for this library.

Since Jest v21.0.0, there is an unhandledRejection handler that will fail tests that don't handle promise rejections.

Loadable leaves an unhandled promise rejection when the loader promise is rejected and consequently the test fails. This makes cases where the error case is expected impossible to test.

This change stops throwing err in the catch of the promise, so the promise rejection is handled.
I believe this is not an issue as the promise is not returned and therefore cannot be chained onto, making the rejection unnecessary in the first place.

@jamiebuilds jamiebuilds merged commit 2222c64 into jamiebuilds:master Nov 27, 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.

2 participants