In this last chapter of the book, we learned how to write concise unit tests for our components. We followed a BDD style approach of writing tests, and we also covered the basics of the JavaScript testing framework, Jasmine.
We learned about the debugging tools that are available in Angular, and how to set up an environment for testing. Using the Angular Testbed utility class, we were able to perform tests in a very flexible but precise way. We also learned about the debug view tree and the component fixture. These allowed us to perform clever inspections and apply practical queries to the rendered views, in order to assert expected results.
We used the inject and async helpers to inject dependencies, and to run asynchronous tests at the same time. We built mock components, in order to isolate our tests from the rest of our application.