Tuesday, May 21, 2019

I just want to hand in the store at an Angular component's constructor and not wrap it in a service abstracted behind a contract. So how can I test the component?

Well, the NgRx folks had deprecated .select in favor or typeable operators, but that is no longer the case. .select is legit and you can make a mock of your store that just fakes both .dispatch and .select. This means that you have to use .select instead of .pipe with a select inside of it when you actually have a .select. You can create a testbed that imposes the mock. I don't understand it all yet. That is coming tomorrow hopefully.

No comments:

Post a Comment