import { toHaveBeenCalledTimes } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/mod.ts";
Use .toHaveBeenCalledTimes
to ensure that a mock object got called exact
number of times
import { expect, fn, test } from "https://deno.land/x/unitest@$VERSION/mod.ts";
test("passes when mock object called 2 times", () => {
const mockObject = fn();
mockObject();
mockObject();
expect(mockObject).toHaveBeenCalledTimes(2);
});