What is the .component.spec file used for angular2

3

I'm using the angular cli in my project, and when generating a component, it automatically creates a .component.spec.ts file

Can anyone tell me what this .spec file is for? Do I really need it or can I exclude it?

    
asked by anonymous 22.09.2016 / 19:11

1 answer

2

The spec files are unit tests for the source files. The convention for Angular 2 applications is to have a .spec.ts file for each .ts file.

Documentation: link

    
22.09.2016 / 19:26