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

std/testing/mock.ts>Stub

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
interface Stub
implements Spy<Self, Args, Return>
import { type Stub } from "https://deno.land/std@0.150.0/testing/mock.ts";

An instance method replacement that records all calls made to it.

Type Parameters

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

Properties

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

The function that is used instead of the original.