import { toHaveReturnedWith } from "https://deno.land/x/unitest@v1.0.0-beta.82/matcher/mod.ts";
Use .toHaveReturnedWith
to ensure that a mock object returned a specific
value
import { expect, fn, test } from "https://deno.land/x/unitest@$VERSION/mod.ts";
test("passes when mock object returned specific value", () => {
const mockObject = fn((a: number, b: number) => a + b);
mockObject(1, 2);
mockObject(3, 4);
expect(mockObject).toHaveReturnedWith(7);
expect(mockObject).toHaveReturnedWith(3);
});