Skip to content

Connectum API Reference / @connectum/testing / index / MockFn

Interface: MockFn()<F>

Defined in: mock-compat.ts:27

A callable spy that records every invocation.

The shape intentionally mirrors the subset of node:test mock.fn() that Connectum testing utilities rely on.

Type Parameters

F

F extends (...args) => any

MockFn(...args): ReturnType<F>

Defined in: mock-compat.ts:28

A callable spy that records every invocation.

The shape intentionally mirrors the subset of node:test mock.fn() that Connectum testing utilities rely on.

Parameters

args

...Parameters<F>

Returns

ReturnType<F>

Properties

mock

readonly mock: object

Defined in: mock-compat.ts:30

Spy metadata.

calls

readonly calls: readonly MockCall<Parameters<F>>[]

Ordered list of recorded calls.

callCount()

callCount(): number

Returns the total number of recorded calls.

Returns

number