Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
class MethodVerifier
import { MethodVerifier } from "https://deno.land/x/rhum@v2.1.0/src/verifiers/method_verifier.ts";

Test doubles use this class to verify that their methods were called, were called with a number of args, were called with specific types of args, and so on.

Constructors

new
MethodVerifier(methodName?: MethodOf<OriginalObject>)

Type Parameters

OriginalObject

Properties

readonly
method_name: MethodOf<OriginalObject> | null

Methods

toBeCalled(
actualCalls: number,
expectedCalls?: number,
codeThatThrew?: string,
): this

Verify that the actual calls match the expected calls.

toBeCalledWithArgs(
actualArgs: unknown[],
expectedArgs: unknown[],
codeThatThrew?: string,
): this

Verify that this method was called with the given args.

toBeCalledWithoutArgs(actualArgs: unknown[], codeThatThrew?: string): this

Verify that this method was called without args.