What is the .component.spec file for at angular2

Asked

Viewed 1,358 times

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?

  • Must be something related to specifications or configuration of TypeScript.

  • @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.

2 answers

3

  • 1

    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

You are not signed in. Login or sign up in order to post.