🐕

【Dart】async functionでthrowされないことをassertする

2024/04/11に公開
  • expectLater
  • completes
Future<String> fetchData() async {
  // do something
  return 'finish';
}

test('fetchData completes without errors', () {
  await expectLater(
    fetchData(),
    completes,
  );
});

https://api.flutter.dev/flutter/flutter_test/expectLater.html

Awarefy 技術ブログ

Discussion