Skip to main content

Module ws_script

Module ws_script 

Source
Expand description

Shared WebSocket-test driver.

Drives a WebSocketScriptRenderer through the canonical sequence a scripted WebSocket fixture takes:

  1. render_test_open — language-native test header.
  2. render_connect — open WS connection (let conn = client.connect_websocket(path)).
  3. For each scripted message:
    • direction = sendrender_send_text / render_send_json / render_send_binary.
    • direction = receiverender_expect_text / render_expect_json / render_expect_binary.
  4. render_close — close the connection with the expected close code.
  5. render_test_close — closing brace / end.

The fixture schema for WebSocket scripts lives in fixtures/websocket*.json — see the SSE/WS subset in crate::fixture::HttpFixture (currently the WS schema is loaded as raw JSON; a typed schema will be introduced in a follow-up once the language renderers are in place and we know exactly which fields they consume).

Traits§

WebSocketScriptRenderer
Per-language WebSocket script renderer.

Functions§

render_ws_test
Render a WebSocket script test for fixture to out using renderer.