The .spec.ts files are for unit tests for individual components. You can run Karma task runner through ng test . In order to see code coverage of unit test cases for particular components run ng test –code-coverage.
What are spec TS files in angular?
spec. ts file. This file contains unit tests for the main AppComponent. When running tests using the Angular CLI, all unit tests in files with the *.
How do I create a spec TS file?
- component.
- service.
- guard.
- resolver.
- directive.
- pipe.
- interceptor.