Signal Test
#200
Replies: 2 comments
-
Does you have some example tests you want to make sure are possible? |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can test a signal with streams, does this work for you? test('test as stream', () {
final s = signal(0);
final stream = s.toStream();
s.value = 1;
s.value = 2;
s.value = 3;
expect(stream, emitsInOrder([0, 1, 2, 3]));
});
test('test with override', () {
final s = signal(0).overrideWith(-1);
final stream = s.toStream();
s.value = 1;
s.value = 2;
s.value = 3;
expect(stream, emitsInOrder([-1, 1, 2, 3]));
}); |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Can we please have a signal testing package similar to https://pub.dev/packages/bloc_test? It would be great to have a standard way for testing signals.
Beta Was this translation helpful? Give feedback.
All reactions