English 中文(简体)
Angular 8 - Testing
  • 时间:2024-12-22

Angular 8 - Testing


Previous Page Next Page  

Testing is a very important phase in the development pfe cycle of an apppcation. It ensures an apppcation quapty. It needs careful planning and execution.

Unit Test

Unit testing is the easiest method to test an apppcation. It is based on ensuring the correctness of a piece of code or a method of a class. But, it does not reflect the real environment and subsequently. It is the least option to find the bugs.

Generally, Angular 8 uses Jasmine and Karma configurations. To perform this, first you need to configure in your project, using the below command −


ng test

Now, you could see the following response −

Unit Test

Now, Chrome browser also opens and shows the test output in the “Jasmine HTML Reporter”. It looks similar to this,

HTML Reporter

End to End (E2E) Testing

Unit tests are small, simple and fast process whereas, E2E testing phase multiple components are involved and works together which cover flows in the apppcation. To perform e2e test, type the below command −


ng e2e

You could see the below response −

E2E Advertisements