glyde/testing/frames
The frames a scripted Discord sends, as the text a transport hands a shard. Fixtures only: nothing here runs anything or judges an adapter.
glyde/testing/adapter scripts its scenarios out of these, and a test
with its own scripted socket can use them without pulling in the
conformance suite.
import glyde/testing/frames
let script = [frames.hello(45_000), frames.ready(1, session, host)]
Values
pub fn beat_request() -> String
Op 1: Discord asking for a heartbeat now rather than at the deadline.
pub fn dispatch(
name: String,
seq: Int,
data: json.Json,
) -> String
Op 0. Any dispatch, with the payload you give it.
pub fn hello(interval_ms: Int) -> String
Op 10. heartbeat_interval is clamped to [1000, 600_000] by the core.
pub fn ready(
seq: Int,
session_id: String,
resume_host: String,
) -> String
Op 0 with t: READY, carrying the three keys the protocol needs.