Skip to content

Test for socketio #44

@EArminjon

Description

@EArminjon

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());
  });
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions