diff --git a/packages/ember-testing/lib/helpers.js b/packages/ember-testing/lib/helpers.js index 3d6790e72f6..465bdd1d2fd 100644 --- a/packages/ember-testing/lib/helpers.js +++ b/packages/ember-testing/lib/helpers.js @@ -242,7 +242,7 @@ helper('currentURL', currentURL); @return {Object} A promise that will never resolve @public */ -helper('pauseTest', pauseTest); +asyncHelper('pauseTest', pauseTest); /** Triggers the given DOM event on the element identified by the provided selector. diff --git a/packages/ember-testing/lib/helpers/pause_test.js b/packages/ember-testing/lib/helpers/pause_test.js index f0ce59124a6..b367fe0f3e4 100644 --- a/packages/ember-testing/lib/helpers/pause_test.js +++ b/packages/ember-testing/lib/helpers/pause_test.js @@ -1,7 +1,5 @@ import RSVP from 'ember-runtime/ext/rsvp'; -import Test from '../test'; export default function pauseTest() { - Test.adapter.asyncStart(); return new RSVP.Promise(function() { }, 'TestAdapter paused promise'); } diff --git a/packages/ember-testing/tests/helpers_test.js b/packages/ember-testing/tests/helpers_test.js index c8a68445ecc..2a4be336a28 100644 --- a/packages/ember-testing/tests/helpers_test.js +++ b/packages/ember-testing/tests/helpers_test.js @@ -772,11 +772,14 @@ QUnit.module('ember-testing debugging helpers', { QUnit.test('pauseTest pauses', function() { expect(1); + function fakeAdapterAsyncStart() { - ok(true, 'Async start should be called'); + ok(true, 'Async start should be called after waiting for other helpers'); } - Test.adapter.asyncStart = fakeAdapterAsyncStart; + App.testHelpers.andThen(() => { + Test.adapter.asyncStart = fakeAdapterAsyncStart; + }); App.testHelpers.pauseTest(); });