ReverbFake class
A real Reverb client wired to an in-memory socket you control.
The client is genuine — subscribe, dispatch and teardown all run the production code paths. Only the socket is fake, so a test proves the same thing a server would, without one.
Constructors
- ReverbFake({String namespace = r'App\Events', void onError(Object error, StackTrace? stackTrace)?})
- Creates a fake and its client.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- reverb → Reverb
-
The client under test. Wire your application to this.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sent
→ List<
Map< String, dynamic> > -
Every frame the client has sent, decoded.
no setter
Methods
-
connect(
) → Future< void> - Connects the client and completes the handshake.
-
dispose(
) → void - Releases the client. Call this at the end of every test.
-
drop(
) → Future< void> - Drops the socket from the server side.
-
emit(
String channel, String event, [Map< String, dynamic> data = const <String, dynamic>{}]) → void -
Delivers
eventonchannelas the server would. -
emitFrame(
Map< String, dynamic> frame) → void -
Delivers
frameexactly as written, for what emit cannot express. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited