Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
class MockBuilder
import { MockBuilder } from "https://deno.land/x/rhum@v2.0.0/src/mock/mock_builder.ts";

Builder to help build a mock object. This does all of the heavy-lifting to create a mock object. Its create() method returns an instance of Mock, which is basically an original object with added data members for verifying behavior.

Constructors

new
MockBuilder(constructorFn: Constructor<ClassToMock>)

Construct an object of this class.

Type Parameters

ClassToMock

Methods

Create the mock object.

withConstructorArgs(...args: unknown[]): this

Before constructing the mock object, track any constructor function args that need to be passed in when constructing the mock object.