value_listenable_test

Creator: coderz1093

Last updated:

0 purchases

value_listenable_test Image
value_listenable_test Images

Languages

Categories

Add to Cart

Description:

value listenable test

value_listenable_test #
Assists in testing ValueListenable objects (ex: ValueNotifier).
install #
Added in your pubspec.yaml as dev dependency:
dev_dependencies:
value_listenable_test: any
copied to clipboard
Examples #
Listen the emits of ValueListenable:
test('valueListenable Matcher', () {
final counter = ValueNotifier(0);
expect(counter, emitValues([2, 3, 5]));
counter.value = 2;
counter.value = 3;
counter.value = 5;
});
copied to clipboard
Also, you can use the test abstraction called valueListenableTest:
valueListenableTest(
'Counter emits [1] when update method is called',
build: () => Counter(),
act: (notifier) => notifier.update(1),
expect: () => [1],
);
copied to clipboard
That`s it!

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.