FakeCanister
Defined in: core/src/testing/fake-replica.ts:64
A canister the fake replica routes calls to, by method name and raw Candid.
Each handler receives the method name, the Candid-encoded argument and the
call context, and returns the Candid-encoded reply. A handler that throws
rejects the call as a canister trap does. A canister without query
rejects every query, and one without update every update call.
createTestCanister builds one from typed handlers, which is what a test usually wants; implement this interface directly to answer with bytes the service’s Candid types would not produce.
Methods
Section titled “Methods”query()?
Section titled “query()?”
optionalquery(method,arg,context):Uint8Array<ArrayBufferLike> |Promise<Uint8Array<ArrayBufferLike>>
Defined in: core/src/testing/fake-replica.ts:65
Parameters
Section titled “Parameters”method
Section titled “method”string
Uint8Array
context
Section titled “context”Returns
Section titled “Returns”Uint8Array<ArrayBufferLike> | Promise<Uint8Array<ArrayBufferLike>>
update()?
Section titled “update()?”
optionalupdate(method,arg,context):Uint8Array<ArrayBufferLike> |Promise<Uint8Array<ArrayBufferLike>>
Defined in: core/src/testing/fake-replica.ts:70
Parameters
Section titled “Parameters”method
Section titled “method”string
Uint8Array
context
Section titled “context”Returns
Section titled “Returns”Uint8Array<ArrayBufferLike> | Promise<Uint8Array<ArrayBufferLike>>