I'm trying to use TestScheduler
to write unit test for my RxJs functions. There are many posts related to it, and I'm following this post : https://medium.com/@kevinkreuzer/marble-testing-with-rxjs-testing-utils-3ae36ac3346a
There is one confusing point for the following part:
I don't understand why we need to pass the callback function into TestScheduler
constructor. In the post, it mentioned that it is assertDeppEqual function which tells the TestScheduler how to compare values. The methods used to compare values depends on your testing framework.
But this explanation is not clear for me. I don't figure out what's the relationship between this function and the actual test logic we write, for example the following case:
in the above case, it assert that expectObservable().toBe()
. what's the relationship between them?