Unit-testing Angular applications

Over the course of this book, we have built components that cover every construct available in Angular. We have built components, pipes, a few services, and finally some directives too. All of these are testable in unit tests.

The code for the rest of this chapter can be found in checkpoint 7.2. It is available on GitHub (https://github.com/chandermani/angular6byexample) for everyone to download. Checkpoints are implemented as branches in GitHub. If you are not using Git, download the snapshot of checkpoint7.2 (a ZIP file) from this GitHub location: https://github.com/chandermani/angular2byexample/archive/checkpoint7.2.zip. Refer to the README.md file in the trainer folder when setting up the snapshot for the first time.

Just to get the hang of unit testing with Jasmine, let's test the smallest and easiest component first: the pipe.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.5.86