Self-tests with in-process mock WebSocket JSON-RPC server #16
Labels
No labels
area:assertions
area:cli
area:client
area:harness
area:meta
area:reporting
area:runner
type:user-story
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/ws-rpc-test#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a framework maintainer, I want to run the framework against itself without depending on a real application binary, so that CI is fast, hermetic, and doesn't drift when external apps change.
Acceptance criteria
Mock server
tests/mock_server.rs(orsrc/testing/mock.rsbehind#[cfg(any(test, feature = "testing"))]) exposes aMockServerthat:on(method, |params| -> Result<Value, RpcError>)to register handlers.emit(method, params)to push notifications to all connected clients.shutdown()method.Self-tests (
tests/framework_tests.rs)RpcClienthas at least one test:callhappy path and JSON-RPC error pathcall_timeoutactually times outsubscribefilters work (replace semantics)wait_formatches a buffered notificationwait_formatches a fresh notificationwait_fortimes out cleanlywait_for_anyreturns the matched methodcollect_eventscollects exactly the events emitted in the windowcall_and_waitworks without race when the event is emitted before the call responseSkip(...)andskip_if.Performance
References
tests/framework_tests.rs); §11 (future extension: WebSocket server mock — being delivered now since v0.1 needs it)