If I were to play around and execute the code snippet below:
await expect(async () => {
const asyncFunc = async () => {
return Promise.reject(new Error('Foo'))
};
await asyncFunc();
}).toThrow();
I assumed it would pass since the promise is rejected with an error, but surprisingly it passes. Is there a method to confirm that the async function actually throws the error?