I find it interesting that you seem to default to marbles, but switch to direct subscription only when necessary. I personally go in the opposite direction. Do you think there's a solid reason for your approach, or is it more personal preference?
One of the situations where I abandon subscription for marbles is when I have a filter in my effect. I haven't figured out a satisfying way to test an Observable that doesn't ever emit anything, except through a marble test that asserts a cold('') result. If you build upon this article in the future (or if Brandon snaps it up for NgRx documentation), that might be a good 6th pattern to add.
It's just something I'm used to - I think marbles tests maybe look a little neater? I did consider rewriting this to ignore marbles entirely though.
For filters and testing with subscriptions I'd just do what I did in the last pattern and then ensure that output is still undefined. Testing for a negative is always going to be a bit flaky though, imo.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Two thoughts:
cold('')
result. If you build upon this article in the future (or if Brandon snaps it up for NgRx documentation), that might be a good 6th pattern to add.It's just something I'm used to - I think marbles tests maybe look a little neater? I did consider rewriting this to ignore marbles entirely though.
For filters and testing with subscriptions I'd just do what I did in the last pattern and then ensure that
output
is still undefined. Testing for a negative is always going to be a bit flaky though, imo.