riverpod_test library
A testing library which makes it easy to test riverpod providers. Built to be used with the riverpod package.
Functions
-
asyncNotifierTest<
C extends AsyncNotifierBase< (State> , State>{required AsyncNotifierProviderBase< C, State> provider, FutureOr<void> setUp()?, List<Override> overrides = const [], dynamic expect()?, AsyncValue<State> ? seed, dynamic act(C notifier)?, Duration? wait, int skip = 0, dynamic verify(C notifier)?, dynamic errors()?, FutureOr<void> tearDown()?, bool emitBuildStates = false}) → Future<void> - Internal testAsyncNotifier runner which is only visible for testing. This should never be used directly - please use testAsyncNotifier instead.
-
notifierTest<
C extends NotifierBase< (State> , State>{required NotifierProviderBase< C, State> provider, FutureOr<void> setUp()?, List<Override> overrides = const [], dynamic expect()?, State? seed, dynamic act(C notifier)?, Duration? wait, int skip = 0, dynamic verify(C notifier)?, dynamic errors()?, FutureOr<void> tearDown()?, bool emitBuildStates = false}) → Future<void> - Internal testNotifier runner which is only visible for testing. This should never be used directly - please use testNotifier instead.
-
providerTest<
State> ({required ProviderBase< State> provider, FutureOr<void> setUp()?, List<Override> overrides = const [], dynamic expect()?, Duration? wait, dynamic verify()?, dynamic errors()?, FutureOr<void> tearDown()?}) → Future<void> - Internal testProvider runner which is only visible for testing. This should never be used directly - please use testProvider instead.
-
resultProviderTest<
Result> ({required ProviderBase< Result> provider, FutureOr<void> setUp()?, List<Override> overrides = const [], dynamic expect()?, dynamic verify(Result result)?, dynamic errors()?, FutureOr<void> tearDown(Result result)?, dynamic act(Result result)?}) → Future<void> - Internal testResultProvider runner which is only visible for testing. This should never be used directly, please use testResultProvider instead.
-
stateNotifierTest<
C extends StateNotifier< (State> , State>{required StateNotifierProvider< C, State> provider, FutureOr<void> setUp()?, List<Override> overrides = const [], dynamic expect()?, State? seed, dynamic act(C notifier)?, Duration? wait, dynamic verify()?, dynamic errors()?, FutureOr<void> tearDown()?, bool emitBuildStates = false}) → Future<void> - Internal testStateNotifier runner which is only visible for testing. This should never be used directly - please use testStateNotifier instead.
-
testAsyncNotifier<
C extends AsyncNotifierBase< (State> , State>String description, {required AsyncNotifierProviderBase< C, State> provider, FutureOr<void> setUp()?, List<Override> overrides = const [], dynamic expect()?, AsyncValue<State> ? seed, dynamic act(C notifier)?, Duration? wait, int skip = 0, dynamic verify(C notifier)?, dynamic errors()?, FutureOr<void> tearDown()?, bool emitBuildStates = false}) → void -
Creates a new
AsyncNotifier
test case with the givendescription
. testAsyncNotifier will handle asserting that thenotifier
emits theexpect
ed states (in order) afteract
is executed. testAsyncNotifier also handles ensuring that no additional states are emitted by closing theprovider
before evaluating theexpect
ation. -
testNotifier<
C extends NotifierBase< (State> , State>String description, {required NotifierProviderBase< C, State> provider, FutureOr<void> setUp()?, List<Override> overrides = const [], dynamic expect()?, State? seed, dynamic act(C notifier)?, Duration? wait, int skip = 0, dynamic verify(C notifier)?, dynamic errors()?, FutureOr<void> tearDown()?, bool emitBuildStates = false}) → void -
Creates a new
Notifier
test case with the givendescription
. testNotifier will handle asserting that thenotifier
emits theexpect
ed states (in order) afteract
is executed. testNotifier also handles ensuring that no additional states are emitted by closing theprovider
before evaluating theexpect
ation. -
testProvider<
State> (String description, {required ProviderBase< State> provider, FutureOr<void> setUp()?, List<Override> overrides = const [], dynamic expect()?, Duration? wait, dynamic verify()?, dynamic errors()?, FutureOr<void> tearDown()?}) → void -
Creates a new
Provider
test case with the givendescription
. testProvider will handle asserting that theprovider
emits theexpect
ed afterprovider
is read. -
testResultProvider<
Result> (String description, {required ProviderBase< Result> provider, FutureOr<void> setUp()?, List<Override> overrides = const [], dynamic expect()?, dynamic verify(Result result)?, dynamic errors()?, FutureOr<void> tearDown(Result result)?, dynamic act(Result result)?}) → void -
Creates a new
Result Provider
test case with the givendescription
. testResultProvider will handle asserting that theprovider result
emits theexpect
ed afteract
is executed. -
testStateNotifier<
C extends StateNotifier< (State> , State>String description, {required StateNotifierProvider< C, State> provider, FutureOr<void> setUp()?, List<Override> overrides = const [], dynamic expect()?, State? seed, dynamic act(C notifier)?, Duration? wait, dynamic verify()?, dynamic errors()?, FutureOr<void> tearDown()?, bool emitBuildStates = false}) → void -
Creates a new
Notifier
test case with the givendescription
. testStateNotifier will handle asserting that thenotifier
emits theexpect
ed states (in order) afteract
is executed. testStateNotifier also handles ensuring that no additional states are emitted by closing theprovider
before evaluating theexpect
ation.