Skip to content

FaultyFetchOptions

Defined in: src/testing/index.ts:15

optional rate?: number

Defined in: src/testing/index.ts:18

Probability, 0 to 1, that a call gets a fault.

1

faults: readonly Fault[]

Defined in: src/testing/index.ts:20

The faults to pick from, uniformly. Required and non-empty.


optional seed?: 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.


optional match?: (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.

Request

boolean