Skip to main content
Module

std/testing/mock.ts>stub

Deno standard library
Go to Latest
function stub
import { stub } from "https://deno.land/std@0.136.0/testing/mock.ts";

Replaces an instance method with a Stub.

Type Parameters

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

Parameters

self: Self
property: keyof Self

Type Parameters

Self
Args extends unknown[]
Return

Parameters

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

Type Parameters

Self
Args extends unknown[]
Return

Parameters

self: Self
property: keyof Self
optional
func: (this: Self, ...args: Args) => Return