Skip to main content
Module

x/rhum/mod.ts>Dummy

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

Create a dummy.

Per Martin Fowler (based on Gerard Meszaros), "Dummy objects are passed around but never actually used. Usually they are just used to fill parameter lists."

Parameters

optional
constructorFn: Constructor<T>
  • The constructor function to use to become the prototype of the dummy. Dummy objects should be the same instance as what they are standing in for. For example, if a SomeClass parameter needs to be filled with a dummy because it is out of scope for a test, then the dummy should be an instance of SomeClass.

Returns

A dummy object being an instance of the given constructor function.