OperationMockState
Represents the mocking state for a single API operation.
Each operation is either passing traffic through to the actual network, returning a specific mock response, or simulating a network failure. The variants are represented as distinct types, eliminating any ambiguous state combinations that existed in a previous boolean-flag approach.
Variants
| Variant | Behavior | displayName |
|---|---|---|
| Network | All requests pass through to the actual network (default) | "Network" |
| Mock | Requests return the selected response variant | "$statusCode - $exampleName" |
| Failure | Requests fail with the selected FailureKind | e.g. "Timeout" |
| Sequence | Requests advance through an ordered list, sticking on the last | e.g. "200 - default (2/3)" |
See also
Inheritors
Types
The operation will deterministically simulate a network failure instead of returning any response — every request to it fails the same way, the same way Mock always serves the same response.
The operation will pass all requests through to the actual network.
The operation advances through responses in order on each successive matched request, sticking on the last response once exhausted rather than looping back to the start or falling through to the real network — the least surprising default, and the one that matches how a real async-completion flow behaves (the terminal state is stable).