testing library

Test support for DartWay clients and the screens on top of them: an in-memory server that speaks the HTTP contract and the live socket, a storage for uploads beside it, page helpers, and a stream recorder.

Classes

DwFakeCall
What a fake handler knows about the call, and how it publishes.
DwFakeConnection
One live connection as the fake server sees it.
DwFakeObject
A stored object of DwFakeStorage.
DwFakeRecordedCall
One call the fake server answered.
DwFakeServer
An in-memory DartWay server for tests of the client and of the screens on top of it: the HTTP contract through httpTransport and the live socket through liveConnector.
DwFakeStorage
File uploads for tests of a client and the screens on top of it: the framework's file calls answered by a DwFakeServer, and a storage in memory behind transport that holds a ticket to what a presigned URL holds real clients to — the signed length and type, no overwrite.
DwStreamRecording<T>
Records what a stream emits, for assertions over a sequence of states.

Constants

dwFakeClientOptions → const DwClientOptions
Client timings for tests against the fake server: short retries and no release or idle delay, so a test sees the effects of what it did at once.

Functions

dwFakeOffsetPage<T extends DwDataObject>(List<T> ordered, DwPageRequest<T> request, DwPageQuery? page) → DwPageResult<T>
The page of ordered a DwPageRequest call asks for, as a DartWay server serves it: rows after the offset, at the size the request serves for the call, reading one row past the page to learn hasMore.
dwFakeTablePage<T extends DwDataObject>(List<T> ordered, DwTableRequest<T> request) → DwTablePage<T>
The numbered page of ordered a DwTableRequest asks for.
dwFakeWindow<T extends DwDataObject>(List<T> newestFirst, DwWindowRequest<T, Object, Object> request, DwPageQuery? page) → DwWindowResult<T>
The window of newestFirst a DwWindowRequest call asks for, with the cursors a DartWay server builds from the request's positionOf.

Typedefs

DwFakeHandler<C> = FutureOr<DwCallResult<Object?>> Function(C call, DwFakeCall context)
A handler of the fake server: the outcome of one call.

Exceptions / Errors

DwFakeNetworkException
The network failure the fake transport throws while DwFakeServer.reachable is false.