In the project, we have many test cases wrapped in try-catch. In the error situation, the assertion error test cases can pass. But if the test case passes, the test case cannot assert to fail to notify the developer.
Previous error test case
it(xxx,()=>{
try {
method()
}catch {
expect(xxxx)
}
})
Prefer
it(xxx,()=>{
await expect(method).to.be.rejectedWith(xxx)
}
})