testing/cross_backend/ws_endpoint.ts view source
(target: WsEndpointTarget, account: WsSessionAccount, options: OpenSessionWsOptions): Promise<WsTransportClient> import {open_session_ws} from '@fuzdev/fuz_app/testing/cross_backend/ws_endpoint.js'; Open a real-upgrade socket on target as account's session: its session
cookie on the upgrade, target.origin (or base_url) as the Origin.
The cookie is the static one account.create_session_headers carries, not
whatever fixture.transport's jar holds now, so a case that rotates the
session through fixture.transport first upgrades on the stale cookie.
target
the backend's WebSocket endpoint
account
the account whose session the socket upgrades on
options
whether to wait for admission, plus transport extras
returns
Promise<WsTransportClient>
the open socket
throws
Error- if the account carries no session cookie, or the upgrade (or the admission heartbeat) fails