Skip to main content
Module

x/mock/mod.ts>stub

Utilities to help mock behavior, spy on function calls, stub methods, and fake time for tests.
Very Popular
Latest
function stub
import { stub } from "https://deno.land/x/mock@0.15.2/mod.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