import { spyOn } from "https://deno.land/x/unitest@v1.0.0-beta.82/mock/mod.ts";
tracks calls to object method name This function has a side effect.
import { spyOn, test, expect } from "https://deno.land/x/unitest@$VERSION/mod.ts";
const video = {
play() {
return true;
},
};
test("plays video", () => {
const spy = spyOn(video, "play");
const isPlaying = video.play();
expect(spy).toHaveBeenCalled();
expect(isPlaying).toBe(true);
});
Returns
MockObject<any>