
Angular Cookbook
By :

If you're building an Angular application, it is very likely that you'll work with Observables inside the app at some point. For instance, you could be fetching data from a third-party API or perhaps just managing the state. In either case, it becomes slightly difficult to test applications that have Observables in action. In this recipe, we're going to learn how to test unit tests with Observables.
The project for this recipe resides in chapter10/start_here/unit-testing-observables
. Perform the following steps:
npm install
to install the dependencies of the project. ng serve -o
. This should open the app in a new browser tab. You should see something similar to the following screenshot:
Figure 10.14 – The unit-testing-observables app running on http://localhost:4200
Now...