Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/deps/std/testing/mock.ts>Spy

Deno-powered framework for building business web apps
Go to Latest
interface Spy
import { type Spy } from "https://deno.land/x/netzo@0.3.91/deps/std/testing/mock.ts";

A function or instance method wrapper that records all calls made to it.

Type Parameters

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

Call Signatures

(this: Self, ...args: Args): Return

Properties

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

The function that is being spied on.

calls: SpyCall<Self, Args, Return>[]

Information about calls made to the function or instance method.

restored: boolean

Whether or not the original instance method has been restored.

Methods

restore(): void

If spying on an instance method, this restores the original instance method.