I have a function as follows:
async foo() : Promise<Object> {
if(...) throw new Error
}
How am I supposed to test that the error is thrown? Currently I'm doing this:
it("testing for error thrown", async function () {
expect(async() => await foo()).to.throw(Error)
})