View source Improve this doc

# `$timeout`
service in module `ngMock`

## Description

This service is just a simple decorator for `$timeout` service that adds a "flush" and "verifyNoPendingTasks" methods.

## Usage

    $timeout();

## Methods

- ### flush(delay)

  Flushes the queue of pending tasks.

  ##### Parameters

  Param | Type | Details
  --- | --- | ---
  delay (optional) | number | maximum timeout amount to flush up until

- ### flushNext(expectedDelay)

  Flushes the next timeout in the queue and compares it to the provided delay

  ##### Parameters

  Param | Type | Details
  --- | --- | ---
  expectedDelay (optional) | number | the delay value that will be asserted against the delay of the next timeout function

- ### verifyNoPendingTasks()

  Verifies that there are no pending tasks that need to be flushed.