Jesway / flutter_translate

Flutter Translate is a fully featured localization / internationalization (i18n) library for Flutter.
MIT License
405 stars 119 forks source link

Test for web platform is not working #95

Closed dioseltorre closed 1 year ago

dioseltorre commented 2 years ago

When you run a test for web platform such as,

flutter test test/some_test.dart --platform chrome

the test seems got stuck on LocalizationDelegate.create(...)

Sample code:

// some_test.dart

Future<Widget> makeTestableWidget() async {
  final delegate = await LocalizationDelegate.create(
    supportedLocales: ['ja', 'en'],
    fallbackLocale: 'en',
  );

  return LocalizedApp(delegate, App());
}

void main() {
  group('use-case', () {
    testWidgets('test-case-1', (WidgetTester tester) async {
      final app = await makeTestableWidget();

      await tester.pumpWidget(app);
      await tester.pumpAndSettle();
      expect(find.text('test'), findsOneWidget);
    });
  });
}
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.