assertThrows with async function
I'm using
assertThrows with an async function and it doesn't seem to work no matter what I try. Any clues? The error is always thrown, but the test still fails.
2 Replies
assertThrows() is for synchronous code. I think assertReject() (see https://jsr.io/@std/assert/doc/~/assertRejects) is what you're looking for.Thanks @marvinh. I'll give that a go. Looks "promising"..