tests and mocks for e2e testing (#78)

* tests and mocks for e2e testing

* formatting

* fix analyze errors
This commit is contained in:
davidliu
2022-02-06 20:36:42 +09:00
committed by GitHub
parent 0d92c569df
commit 9bd546b9a2
22 changed files with 799 additions and 34 deletions
+22
View File
@@ -0,0 +1,22 @@
import 'package:livekit_client/src/support/websocket.dart';
class MockWebSocket extends LiveKitWebSocket {
@override
void send(List<int> data) {}
}
class MockWebSocketConnector {
WebSocketEventHandlers? handlers;
WebSocketOnData get onData => handlers!.onData!;
WebSocketOnDispose get onDispose => handlers!.onDispose!;
WebSocketOnError get onError => handlers!.onError!;
Future<LiveKitWebSocket> connect(Uri uri,
[WebSocketEventHandlers? options]) async {
handlers = options;
return MockWebSocket();
}
}