3
I am 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 file is for. spec? I really need it or I can rule it out?
3
I am 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 file is for. spec? I really need it or I can rule it out?
3
The files of spec
are unit tests for source files.
The convention for Angular 2 applications is to have a file .spec.ts
for each file .ts
.
Documentation: https://angular.io/docs/ts/latest/guide/testing.html
What’s wrong with the answer?
1
In fact .spec.ts files are a way to perform unit testing in Angular 2 with Jasmine’s test structure, you can run the tests with the CLI command "ng test".
Browser other questions tagged angular
You are not signed in. Login or sign up in order to post.
Must be something related to specifications or configuration of
TypeScript
.– Wallace Maxters
@Wallacemaxters as far as I know, Typescript settings (when used) are in a file called
typings
. Unless you’ve changed something in these latest updates.– celsomtrindade