testing library
Cross-transport conformance scenarios.
A transport is only correct if it behaves like every other one, so the scenarios live here rather than in any single package's tests. Implement ParticipationHarness for your backend and call the runner; the assertions are identical for in-memory, WebSocket and LSL.
This library imports package:test and is only for use from test files.
It also reaches dart:io through startTestHub, so it is server-side only.
Classes
- ParticipationHarness
- Supplies transport configs for a run, so one scenario set can be driven over any transport.
- TestHub
- A running hub and everything a client needs to join it.
Functions
-
runParticipationScenarios(
ParticipationHarness harness) → void -
Registers the participation-mode scenarios for
harness. -
startTestHub(
{String session = 'test_session', String secret = 'test-secret-not-for-real-use', WsLimits limits = const WsLimits(), Duration? sessionTtl}) → Future< TestHub> - Starts a hub on an ephemeral port with a fixed, throwaway secret.