Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Latest
class PreProgrammedMethod
import { PreProgrammedMethod } from "https://deno.land/x/rhum@v2.2.0/src/pre_programmed_method.ts";

Class that allows to be a "stand-in" for a method. For example, when used in a mock object, the mock object can replace methods with pre-programmed methods (using this class), and have a system under test use the pre-programmed methods.

Constructors

new
PreProgrammedMethod(methodName: MethodOf<OriginalObject>)

Type Parameters

OriginalObject
ReturnValue

Methods

run(args?: unknown[]): unknown

Run this method.

willReturn(returnValue: ReturnValue | ReturnValueFunction<ReturnValue>): void
willThrow(error: IError): void