Testing Angular Apps

Developers who want to learn how to use Angular 2 to create web apps


Expected Duration
91 minutes

Testing is a major part of the app development process. This course covers setting up a test environment, creating unit tests, executing unit tests, and debugging Angular applications.


Setting up a Test Environment

  • start the course
  • install the Jasmine test framework
  • install the Karma test runner
  • create a test spec file and define a unit test
  • execute unit tests and view results
  • debug unit tests using breakpoints

Testing Pipes and Services

  • test custom pipes you create
  • test custom services you create
  • test custom services that make use of external dependencies

Testing Components

  • create an Angular testing module using Testbed
  • test custom components you create
  • use the detectChanges method effectively in Angular 2 testing
  • set up async compilation for components that use external templates and stylesheets
  • set up test stubs that can be used when components depend on services
  • test custom components that depend on services with async functionality
  • test custom components that are decorated with inputs and outputs
  • test components that are embedded in other components
  • test components that make use of Angular routes
  • test components while ignoring template elements that are irrelevant to those tests
  • test custom attribute directives you create

Practice: Testing an Angular App

  • create and execute unit tests to verify expected functionality in an Angular app





Multi-license discounts available for Annual and Monthly subscriptions.