import { toThrow } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/to_throw.ts";
Use .toThrow
to test that a function throws when it is called
import { expect, test } from "https://deno.land/x/unitest@$VERSION/mod.ts";
test("passes when the function throw error", () => {
expect(() => {
throw Error("test");
}).toThrow(/test/);
});
Parameters
actual: AnyFn