home
  • Blog
  • Home
  • Projects
    • Ember
    • EmberData
    • Ember CLI
2.18
  • Packages
    • @ember/application
    • @ember/array
    • @ember/component
    • @ember/controller
    • @ember/debug
    • @ember/engine
    • @ember/error
    • @ember/object
    • @ember/polyfills
    • @ember/routing
    • @ember/runloop
    • @ember/service
    • @ember/string
    • @ember/test
    • @ember/utils
    • ember-glimmer
    • jquery
  • Classes
    • Adapter
    • Application
    • ApplicationInstance
    • ApplicationInstance.BootOptions
    • ArrayProxy
    • Checkbox
    • Component
    • ComputedProperty
    • ContainerDebugAdapter
    • ContainerProxyMixin
    • Controller
    • CoreObject
    • DataAdapter
    • Ember.Debug
    • Ember.Logger
    • Ember.MutableEnumerable
    • Ember.Namespace
    • Ember.NativeArray
    • Ember.Templates.helpers
    • Ember.Test
    • Ember.Test.QUnitAdapter
    • EmberArray
    • EmberError
    • EmberObject
    • Engine
    • EngineInstance
    • Evented
    • GlobalsResolver
    • HashLocation
    • Helper
    • HistoryLocation
    • LinkComponent
    • Mixin
    • MutableArray
    • NoneLocation
    • ObjectProxy
    • Observable
    • PromiseProxyMixin
    • RSVP.EventTarget
    • RSVP.Promise
    • Route
    • Router
    • RouterService
    • Service
    • String
    • TextArea
    • TextField

Class Ember.Test public


Defined in: packages/ember-testing/lib/test.js:26
Module: ember

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.


Methods

onInjectHelpers (callback) public

Module: ember

Defined in packages/ember-testing/lib/test/on_inject_helpers.js:3

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:

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

  Ember.$(document).ajaxComplete(function() {
    Test.pendingRequests--;
  });
});

promise (resolver, label) public

Module: ember

Defined in packages/ember-testing/lib/test/promise.js:19

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.

resolve (The) public

Module: ember

Defined in packages/ember-testing/lib/test/promise.js:37

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

Properties

adapter public

Module: ember

Defined in packages/ember-testing/lib/test.js:60

Used to allow ember-testing to communicate with a specific testing framework.

You can manually set it before calling App.setupForTesting().

Example:

Ember.Test.adapter = MyCustomAdapter.create()

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

On this page


Methods

  • onInjectHelpers
  • promise
  • resolve

Properties

  • adapter
Team Sponsors Security Legal Branding Community Guidelines
Twitter GitHub Discord Mastodon

If you want help you can contact us by email, open an issue, or get realtime help by joining the Ember Discord.

© Copyright 2025 - Tilde Inc.
Ember.js is free, open source and always will be.


Ember is generously supported by
blue Created with Sketch.