👩💻 Join our community of thousands of amazing developers!
When validating a note, bookmark or snippet on Codever several validation rules might be broken and the response given to the consumer will contain all the corresponding error messages. In the following example we will consider the case of notes and how we can verify in jest repetitive tests if a broken rule is present in the error response. To do that we surround the method under test in a try catch block and use jest expect.arrayContaining assertion on the validationErrors array in the error c...