Skip to content
IC Reactor

TestCanisterHandler

TestCanisterHandler<A, M> = (args, context) => ActorMethodReturnType<A[M]> | Promise<ActorMethodReturnType<A[M]>>

Defined in: core/src/testing/test-canister.ts:26

Answers one method of a test canister: it receives the method’s decoded Candid arguments as a tuple, as callMethod takes them, and returns the method’s Candid result, or a promise of it. A handler that throws rejects the call as a canister trap does.

The arguments and the result are the raw Candid values the canister sees (bigint, Principal, [] | [T] for an opt), whichever reactor the test calls through.

A

M extends FunctionName<A>

ActorMethodParameters<A[M]>

FakeCallContext

ActorMethodReturnType<A[M]> | Promise<ActorMethodReturnType<A[M]>>