I tried to followed the documentation in order to test for the error message using assert.rejects (I do have Node above v10).
But it's always passing, even with a ridiculous message. What am I doing wrong?
it("should fail but it's not",
async ()=> {
let itemId = 'not an id'
assert.rejects(
await ListRepo.checkById(itemId),
{message: 'abracadabra'}
)
}
)
UPDATE: It seems that if I return the assert.rejects, it works. But I still don't know the reason.