diff --git a/cherrypick/pubspec.yaml b/cherrypick/pubspec.yaml index 59ba711..7143029 100644 --- a/cherrypick/pubspec.yaml +++ b/cherrypick/pubspec.yaml @@ -17,3 +17,4 @@ dev_dependencies: test: ^1.25.15 mockito: ^5.0.6 + melos: ^6.3.2 diff --git a/cherrypick/test/src/binding_test.dart b/cherrypick/test/src/binding_test.dart index 34d6c60..9f69647 100644 --- a/cherrypick/test/src/binding_test.dart +++ b/cherrypick/test/src/binding_test.dart @@ -188,6 +188,25 @@ void main() { }); }); + group('Check Async provider.', () { + test('Binding resolves value asynchronously', () async { + final expectedValue = 5; + final binding = Binding().toProvideAsync(() async => expectedValue); + + final result = await binding.asyncProvider?.call(); + expect(result, expectedValue); + }); + + test('Binding resolves value asynchronously with params', () async { + final expectedValue = 5; + final binding = Binding().toProvideAsyncWithParams( + (param) async => expectedValue + (param as int)); + + final result = await binding.asyncProviderWithParams?.call(3); + expect(result, expectedValue + 3); + }); + }); + group('Check singleton provide.', () { group('Without name.', () { test('Binding resolves null', () { diff --git a/cherrypick_flutter/pubspec.yaml b/cherrypick_flutter/pubspec.yaml index 987685f..e041746 100644 --- a/cherrypick_flutter/pubspec.yaml +++ b/cherrypick_flutter/pubspec.yaml @@ -20,6 +20,7 @@ dev_dependencies: sdk: flutter flutter_lints: ^5.0.0 test: ^1.25.7 + melos: ^6.3.2 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/melos.yaml b/melos.yaml index dfb13a0..666468b 100644 --- a/melos.yaml +++ b/melos.yaml @@ -14,4 +14,4 @@ scripts: exec: dart format test: - exec: dart test ./test \ No newline at end of file + exec: flutter test \ No newline at end of file