3 Testing components

This chapter covers

  • Testing components
  • Knowing the differences between isolated and shallow tests
  • Testing classes and functions

Angular applications are built from components, so the most important place to start when testing an Angular application is with component tests. For example, imagine a component that displays a calendar. It might enable a user to select a date, change the selected date, cycle through months and years, and so on. You need to write a test case for each of these pieces of functionality.

In this chapter, we’ll cover key testing classes and functions, such as TestBed, ComponentFixture, and fakeAsync, which help you test your components. You’ll need a good grasp of these classes and functions ...

Get Testing Angular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.