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

x/hex/src/lib/stdx/testing.ts>mock.stub

An ecosystem delivering practices, philosophy and portability. Powered By Deno and JavaScript.
Latest
function mock.stub
import { mock } from "https://deno.land/x/hex@0.6.5/src/lib/stdx/testing.ts";
const { stub } = mock;

Replaces an instance method with a Stub.

Type Parameters

Self
Prop extends keyof Self

Parameters

self: Self
property: Prop

Returns

Stub<Self, GetParametersFromProp<Self, Prop>, GetReturnFromProp<Self, Prop>>

Type Parameters

Self
Prop extends keyof Self

Parameters

self: Self
property: Prop
func: (this: Self, ...args: GetParametersFromProp<Self, Prop>) => GetReturnFromProp<Self, Prop>

Returns

Stub<Self, GetParametersFromProp<Self, Prop>, GetReturnFromProp<Self, Prop>>