Connectum API Reference / @connectum/testing / index / CreateMockContextOptions
Interface: CreateMockContextOptions ​
Defined in: testing/src/mockContext.ts:22
Options for createMockContext.
Properties ​
catalog ​
readonlycatalog:ServiceCatalog
Defined in: testing/src/mockContext.ts:24
The catalog the handler-under-test calls into.
method? ​
readonlyoptionalmethod?:string
Defined in: testing/src/mockContext.ts:42
The method of the handler under test, as "<service typeName>/<method name>" (for example "t.v1.Hello/Say", the key format of ctx.call). It is what the handler reads as ctx.service, ctx.method and ctx.url. Without it the context describes the first method of the first service of the catalog, which is the right answer only for a catalog of one method.
mocks ​
readonlymocks: readonlyMockService[]
Defined in: testing/src/mockContext.ts:26
Mock implementations served via the catalog's resolver path.
outgoingInterceptors? ​
readonlyoptionaloutgoingInterceptors?: readonlyInterceptor[]
Defined in: testing/src/mockContext.ts:28
Optional outgoing interceptors (applied exactly as in production).
propagateHeaders? ​
readonlyoptionalpropagateHeaders?: readonlystring[]
Defined in: testing/src/mockContext.ts:34
Optional header names propagated onto outgoing calls (default none).
requestHeader? ​
readonlyoptionalrequestHeader?:HeadersInit
Defined in: testing/src/mockContext.ts:30
Optional inbound headers (seen by ctx.requestHeader + header propagation).
signal? ​
readonlyoptionalsignal?:AbortSignal
Defined in: testing/src/mockContext.ts:48
Abort signal of the inbound request: ctx.signal aborts when it does, and the abort cascades into the outgoing calls the handler makes. Without it ctx.signal never aborts.
timeoutMs? ​
readonlyoptionaltimeoutMs?:number
Defined in: testing/src/mockContext.ts:32
Optional inbound deadline in ms (drives the ctx.timeoutMs() cascade).