Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/hex/src/di/tests/deps.ts>mock.stub

An ecosystem delivering practices, philosophy and portability.
Go to Latest
function mock.stub
import { mock } from "https://deno.land/x/hex@0.5.15/src/di/tests/deps.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>>