FaultyFetchOptions
Defined in: src/testing/index.ts:15
Properties
Section titled “Properties”
optionalrate?:number
Defined in: src/testing/index.ts:18
Probability, 0 to 1, that a call gets a fault.
Default
Section titled “Default”1faults
Section titled “faults”faults: readonly
Fault[]
Defined in: src/testing/index.ts:20
The faults to pick from, uniformly. Required and non-empty.
optionalseed?:number
Defined in: src/testing/index.ts:23
Seed for a deterministic sequence: the same seed gives the same faults in the same order.
Omit it to draw from Math.random.
match?
Section titled “match?”
optionalmatch?: (request) =>boolean
Defined in: src/testing/index.ts:27
Only calls for which this returns true can get a fault; the others pass straight through
and don’t consume a draw from the sequence. It sees the URL, method and headers, not the
signal or the body.
Parameters
Section titled “Parameters”request
Section titled “request”Request
Returns
Section titled “Returns”boolean
