The component, directive, pipe, service, and guard generators in Angular-CLI also create a unique test file stub as well as their class' boilerplate files. These test files are very basic, but they are all differently pre-configured to test their unique type of content.
Running tests in Angular-CLI
How to do it...
Let's see what sort of test results we get from these generated boilerplate tests by running them with the test command in Angular-CLI:
ng test
How it works...
When you run the test command, Angular will run through each of these generated test files and check whether they exist and initialize properly. These simple tests don't know enough about the functionality of your application to do much else, but they are helpful as a place to start writing your own tests. They also provide a small amount of coverage that all the individual parts of your application can properly initialize on its own. You should look at these automatically generated test stubs as a ready-made space for you to add your own tests for your application.