lundi 2 mars 2020

How to test map and tap pipe from RXJS in Angular

I am wanting to test my code below, but I'm not sure how to test the map and tap (from RXJS) functions. Should I make a mock, use a spy?

Should I even really test these? I have a habit of getting 100% coverage for only achieving that goal (100% coverage), but I'm learning that 100% isn't always needed or beneficial. But in this case, map and tap are pretty crucial to the function. I'd really appreciate any advice, thank you.

I am using Angular 9.

The red lines are untested.

enter image description here

Aucun commentaire:

Enregistrer un commentaire