Skip to main content

Module testing

Module testing 

Source
Expand description

Helpers for testing an app on Zero without a server or a real clock (ZeroTesting in the Swift client): a clock that only moves when told to, in-memory sockets a test plays the server on, and a log sink that keeps what was logged.

Structs§

ManualScheduler
A clock that only moves when told to, like fake timers in JS tests.
MockSocket
A socket the test drives: it records what the client sends and delivers what the test receives on the server’s behalf.
MockSocketFactory
Opens in-memory sockets and keeps every one, in opening order, so a test can play the server (MockSocket in packages/zero-client/src/client/test-utils.ts).
RecordingLogSink
Keeps every message logged, with its level.