socket.io-client-dart icon indicating copy to clipboard operation
socket.io-client-dart copied to clipboard

Test for socketio

Open EArminjon opened this issue 5 years ago • 0 comments

Hello,

I would enable unit test for my project which use your socket package. But the following error failed my tests :

The following assertion was thrown running a test:
A Timer is still pending even after the widget tree was disposed.
'package:flutter_test/src/binding.dart':
Failed assertion: line 1056 pos 7: '_currentFakeAsync.nonPeriodicTimerCount == 0'

My test : I test if a widget can build. This widget contain socket_io and socket_io try to connect. My test do not take care of socket_io so i didn't want wait for connection...

Of can i do that :) ? Or how can i wait for connection ?

Test code :

void main() {
  testWidgets('Run app', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(App());
  });
}

EArminjon avatar Dec 01 '19 04:12 EArminjon