Skip to main content

@idpass/data-collect-core / FaultRule

Interface: FaultRule

Defined in: testing/StorageFaultInjector.ts:23

Describes a fault injection rule for a specific operation.

Properties​

operation​

operation: string

Defined in: testing/StorageFaultInjector.ts:25

The method/operation name to intercept


failOnCall?​

optional failOnCall?: number

Defined in: testing/StorageFaultInjector.ts:27

Fail on the Nth call (1-based)


alwaysFail?​

optional alwaysFail?: boolean

Defined in: testing/StorageFaultInjector.ts:29

Fail on every call


error?​

optional error?: Error

Defined in: testing/StorageFaultInjector.ts:31

Custom error to throw (default: new Error("Injected fault: ${operation}"))


delayMs?​

optional delayMs?: number

Defined in: testing/StorageFaultInjector.ts:33

Add delay in milliseconds before returning the result