interface MockBridge extends Required<RunicBridgeClient> An in-memory __runicBridge that answers generated-client routes without .NET.
Properties
now
readonly now: number; The virtual time in milliseconds, which only advance() moves.
pending
readonly pending: number; Queued replies, pushes and timers that are due now or later.
Methods
view
view(route: string, definition: MockViewDefinition): MockView; Serves {route}Snapshot, Mount, Unmount, Set{Property}, Write{Property}, Can{Command}, Start{Command} and the given routes.
route
route(name: string, handler: (...args: unknown[]) => string | Promise<string>): void; Serves a whole route name, such as __runicOperationStatus.
failNext
failNext(name: string, failure: MockFailure, times?: number): void; Answers the next times calls of a whole route name with failure.
disconnect
disconnect(): void; Rejects further calls until reconnect().
reconnect
reconnect(): void; Restores calls and notifies reconnect listeners, as a host transport does after a reconnect.
sleep
sleep(milliseconds: number): Promise<void>; Resolves after milliseconds of virtual time, for handlers that model latency.
flush
flush(): Promise<void>; Delivers every queued reply and push that is due, until the client is idle.
flushUntil
flushUntil<T>(promise: Promise<T>): Promise<T>; Flushes until promise settles, then returns its result. Fails when it cannot settle without time passing.
advance
advance(milliseconds: number): Promise<void>; Moves the virtual clock, delivering timed work in order.