eBay / flutter_glove_box

Various eBay tools for Flutter development
BSD 3-Clause "New" or "Revised" License
323 stars 69 forks source link

support async call in testGoldens #185

Closed zhujiageng closed 10 months ago

zhujiageng commented 10 months ago
import 'package:flutter_test/flutter_test.dart';
import 'package:golden_toolkit/golden_toolkit.dart';

void main() {
  test('async call success', () async {
    await Future(() {
      print('async called');
    });
  });

  testGoldens('async call janked', (tester) async {
    await Future(() {
      print('async will never be called');
    });
  });
}
fatherOfLegends commented 10 months ago

This likely is not related to this package and is likely by design. testGoldens uses testWidgets internally not simply "test()" from dart.