Async matcher does not handle rejections
See original GitHub issueRejections thrown by async matchers are not handled correctly. They end up as Uncaught (in Promise) type errors
To reproduce this:
- go to https://zxcvbn-ts.github.io/zxcvbn/demo/
- In the chrome developer toolbar, disable your internet connection
- Type something in the password field
- You’ll notice the uncaught errors popping up in the developer toolbar
Not having a proper mechanism for error handling means that we cannot use things like the pnwd matcher in production
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Elegantly Handling Reject on `await`ed Javascript Promise
The following won't work because const is block scoped: async function () { try { const result = await get_session() } catch (err)...
Read more >Jest gives no indication that test fails because of unhandled ...
When Jest fails a test for what it thinks - wrongly - is an unhandled rejection, it does not indicate this at all....
Read more >Handling those unhandled promise rejections with JS async ...
… by rejecting a promise which was not handled with .catch(). The solution is simple, either use .catch() as suggested by the message:...
Read more >Promise rejections from signal handlers are silent (#417)
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not...
Read more >Testing promise rejection in JavaScript with Jest - Codeleak.pl
It looks like using try-catch with async/await is the easiest way to achieve this as the rejected value is thrown: it("rejects (bad)", async...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I thought about a config parameter too but this is a bit tricky so first let’s get rid of the major issue and than make it better 👍
Thanks a lot!