Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/mock/mod.ts>spy

Utilities to help mock behavior, spy on function calls, stub methods, and fake time for tests.
Very Popular
Latest
function spy
import { spy } from "https://deno.land/x/mock@0.15.2/mod.ts";

Wraps a function or instance method with a Spy.

Type Parameters

optional
Self = any
optional
Args extends unknown[] = any[]
optional
Return = undefined

Type Parameters

Self
Args extends unknown[]
Return

Parameters

func: (this: Self, ...args: Args) => Return

Type Parameters

Self
Args extends unknown[]
Return

Parameters

self: Self
property: keyof Self