Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
class MethodVerifier
import { MethodVerifier } from "https://deno.land/x/rhum@v2.1.0-rc.1/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.