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