Skip to main content
Module

x/rhum/mod.ts>Stub

A test double library
Latest
function Stub
import { Stub } from "https://deno.land/x/rhum@v2.2.0/mod.ts";

Create a stub function that returns "stubbed".

Type Parameters

OriginalObject

Returns

() => "stubbed"

A function that returns "stubbed".

Take the given object and stub its given data member to return the given return value.

Type Parameters

OriginalObject
ReturnValue

Parameters

  • The object receiving the stub.
dataMember: keyof OriginalObject
  • The data member on the object to be stubbed.
optional
returnValue: ReturnValue
  • (optional) What the stub should return. Defaults to "stubbed".