April 2017
Beginner to intermediate
378 pages
7h 57m
English
Now that we have the required setup, we are going to start writing the unit tests. Unit tests are written in a file next to the source file with .spec added to the filename. For example, if we are writing test cases for app.component.ts, we would create a file named app.component.spec.ts in the same folder and write the required test cases.
Refer to https://angular.io/docs/ts/latest/guide/testing.html#!#q-spec-file-location and https://angular.io/docs/ts/latest/guide/style-guide.html#!#02-10 for more information.
First, we would start off by writing tests for the app component. We are going to test the following cases:
Now, create a file named app.component.spec.ts ...
Read now
Unlock full access