The following are some of the key building blocks to be used when writing unit tests for Angular apps:
- TestBed: This is the most important building block of Angular testing utilities. TestBed is used to create an Angular testing module using the @NgModule class, which is configured using the configureTestingModule method. Invoking configureTestingModule on TestBed creates a testing environment for the component to be tested. Essentially, the component to be tested is detached from its own module and reattached to the Angular testing module. A metadata object declaring the components to be tested is passed to the configureTestingModule method.
After configuring the test environment, the next step is ...