Interface: TransportFault
Defined in: packages/testing/src/transport.ts:55
Properties
after?
optional after?: number;
Defined in: packages/testing/src/transport.ts:59
Skip this many matching calls before the fault starts applying.
dropResponse?
optional dropResponse?: boolean;
Defined in: packages/testing/src/transport.ts:83
Let the call reach the server, then throw as if the response never arrived. The server-side effect HAPPENS. This is the idempotency test.
label?
optional label?: string;
Defined in: packages/testing/src/transport.ts:65
Label used in calls[].fault and error messages.
network?
optional network?: "offline" | "timeout" | "reset";
Defined in: packages/testing/src/transport.ts:77
Fail below HTTP: no status, no response.
op?
optional op?: TransportOp;
Defined in: packages/testing/src/transport.ts:57
Restrict to one operation. Omit to match every operation.
reason?
optional reason?: string;
Defined in: packages/testing/src/transport.ts:72
Wire reason accompanying status, e.g. device_revoked, batch_too_large.
retryAfterMs?
optional retryAfterMs?: number;
Defined in: packages/testing/src/transport.ts:74
Retry-After, in ms, surfaced in details.retryAfterMs.
status?
optional status?: number;
Defined in: packages/testing/src/transport.ts:70
Fail as an HTTP status (docs/10 §1.4 decides the retry class).
times?
optional times?: number;
Defined in: packages/testing/src/transport.ts:61
Apply at most this many times. Default: unlimited.
when?
optional when?: (ctx) => boolean;
Defined in: packages/testing/src/transport.ts:63
Arbitrary extra predicate — e.g. only batches containing a given id.
Parameters
| Parameter | Type |
|---|---|
ctx | { n: number; op: TransportOp; subject: string[]; } |
ctx.n | number |
ctx.op | TransportOp |
ctx.subject | string[] |
Returns
boolean