Skip to main content
Module

x/rhum/mod.ts>Mock

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

Get the builder to create mocked objects.

Per Martin Fowler (based on Gerard Meszaros), "Mocks are pre-programmed with expectations which form a specification of the calls they are expected to receive. They can throw an exception if they receive a call they don't expect and are checked during verification to ensure they got all the calls they were expecting."

Parameters

constructorFn: Constructor<T>
  • The constructor function of the object to mock.

Returns

Instance of MockBuilder.