Skip to content

Fix for unhandled promise rejections in Jest tests#80

Merged
jamiebuilds merged 1 commit intojamiebuilds:masterfrom
mpeyper:master
Nov 27, 2017
Merged

Fix for unhandled promise rejections in Jest tests#80
jamiebuilds merged 1 commit intojamiebuilds:masterfrom
mpeyper:master

Conversation

@mpeyper
Copy link
Copy Markdown
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