Testing Angular Applications
In this section, we will be learning about Angular application testing. Tests are the best way to prevent software defects. As more features are being added and application complexity increases, updating code and checking the browser manually will no longer be easy, sustainable, error free, and will become expensive. Therefore, recent versions of Angular provide a module called HttpClientTestingModule to make testing very easy to perform.
There are two type of tests in Angular: unit testing and e2e testing (also known as functional testing). Unit testing can also be referred to as isolated testing, because it involves testing a small, isolated piece of code. The other type, e2e testing, involves testing the complete functionality of an application in a way that is close to real-life application use (just like a user would interact with it in real life).
Getting Started with Unit Testing
Unit testing an Angular application could involve writing a small isolated...