Replies: 3 comments 3 replies
-
Create a Future/Stream that completes or emit an error when you want final provider = FutureProvider<int>(...);
...
final completer= Completer<int>();
final container = ProviderContainer(overrides: [provider.overrideWith((_) => completer.future)]);
expect(container.read(provider), AsyncLoading<int>());
completer.completeError('err');
await expectLater(
container.read(provider.future),
throwsA('err'),
);
|
Beta Was this translation helpful? Give feedback.
3 replies
-
Since the test API seems less easy than before with async provider, I'm still using |
Beta Was this translation helpful? Give feedback.
0 replies
-
@rrousselGit any news ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since
overrideWithValue
has been removed, how to emulate aAsyncLoading / AsyncError
state of a async provider with the newoverrideWith
method ?Beta Was this translation helpful? Give feedback.
All reactions