If you expect a promise to be rejected, use the ______________ matcher. If the promise is fulfilled, the test will automatically fail.
Answers
Answered by
0
Answer to your question:
♡.resolves
If you expect a promise to be rejected, use the __.resolves__ matcher. If the promise is fulfilled, the test will automatically fail.
Hope it helps^_^
Answered by
0
There are various ways to handle an asynchronous block of code. In this case, use a .resolves matcher in your statement.
This is the easiest way to handle asynchronous tests if your code has used promises. If the promise is rejected, the test fails automatically.
When you use a .resolves matcher in jest if the promise is rejected the test will collapse on its own. The .resolves matcher is also known as the .rejects matcher.
Similar questions