Testing · Junior · Question 25 of 78

How do you check that a promise rejects?

Explanation

.resolves/.rejects unwrap the promise. Don't forget await (or return), otherwise the assertion isn't awaited.

Further reading

Problem with a question

Testing · Junior · question 25

Test yourself

Take the Testing · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz