Class Ember.Test

public

This is a container for an assortment of testing related functionality:

  • Choose your default test adapter (for your framework of choice).
  • Register/Unregister additional test helpers.
  • Setup callbacks to be fired when the test helpers are injected into your application.

Show:

Module: ember
callback
Function
The function to be called.

Used to register callbacks to be fired whenever App.injectTestHelpers is called.

The callback will receive the current application as an argument.

Example:

1
2
3
4
5
6
7
8
9
10
11
import $ from 'jquery';

Ember.Test.onInjectHelpers(function() {
  $(document).ajaxSend(function() {
    Test.pendingRequests++;
  });

  $(document).ajaxComplete(function() {
    Test.pendingRequests--;
  });
});
Module: ember
resolver
Function
The function used to resolve the promise.
label
String
An optional string for identifying the promise.

This returns a thenable tailored for testing. It catches failed onSuccess callbacks and invokes the Ember.Test.adapter.exception callback in the last chained then.

This method should be returned by async helpers such as wait.

Module: ember

Available since v1.2.0

The
Mixed
value to resolve

Replacement for Ember.RSVP.resolve The only difference is this uses an instance of Ember.Test.Promise