interface MockTypedView<TState, TClient, TKind extends string = string> The typed mock of one generated client, created by a generated mock{Name}().
Properties
route
readonly route: string; The route prefix, such as editor for a root View or content1 for content.
reference
readonly reference: MockReference<TKind>; Put this in a parent mock's state to present this View as content.
state
readonly state: TState; No documentation.
revision
readonly revision: number; No documentation.
Methods
update
update(patch: Patch<TState> | ((state: TState) => Patch<TState>)): void; Merges state changes and pushes the new state, like a .NET publication.
failNext
failNext<M extends MockMethodName<TClient>>(method: M, failure: MockErrorFailure | MockDomainFailure<MockFailureOf<TClient[M]>>, times?: number): void; Answers the next times calls of a client method with failure: an unexpected failure, or the method's declared failure as { kind: "domain-failed", failure }.
pushFailure
pushFailure(failure: {
readonly kind?: BridgeErrorKind;
readonly message: string;
readonly detail?: BridgeFailureDetail;
}): void; Pushes a failure notice; the client keeps its last state and reports the error.
batch
batch(edit: () => void): void; Pushes the collection edits made by edit as one delta frame.