Skip to content

Mock WS route() only applies to connections made after the route is set #80

Description

@BenSheridanEdwards

src/mock-server.ts: HTTP routes are consulted per request, but WebSocket fulfill/reject/abort are only read in the 'connection' handler. A test that lets the app connect first and then calls mock.route('/feed').fulfill(...) silently does nothing — toHaveReceived hangs. Either apply route actions to live sockets when route() is called, or document the connection-time semantics loudly in MockRoute. Found during adversarial review (2026-07-02).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions