This is the archived documentation for Angular v5. Please visit angular.io to see documentation for the current version of Angular.

Testability

npm Package @angular/core
Module import { Testability } from '@angular/core';
Source core/src/testability/testability.ts

Overview

      
      class Testability implements PublicTestability {
  constructor(_ngZone: NgZone)
  increasePendingRequestCount(): number
  decreasePendingRequestCount(): number
  isStable(): boolean
  whenStable(callback: Function): void
  getPendingRequestCount(): number
  findProviders(using: any, provider: string, exactMatch: boolean): any[]
}
    

Description

The Testability service provides testing hooks that can be accessed from the browser and by services such as Protractor. Each bootstrapped Angular application on the page will have an instance of Testability.

Constructor

      
      constructor(_ngZone: NgZone)
    

Members

      
      increasePendingRequestCount(): number
    

Increases the number of pending request


      
      decreasePendingRequestCount(): number
    

Decreases the number of pending request


      
      isStable(): boolean
    

Whether an associated application is stable


      
      whenStable(callback: Function): void
    

Run callback when the application is stable


      
      getPendingRequestCount(): number
    

Get the number of pending requests


      
      findProviders(using: any, provider: string, exactMatch: boolean): any[]
    

Find providers by name

Annotations

      
      @Injectable()