Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] Ensure pauseTest runs after other async helpers #13605

Merged
merged 1 commit into from
Jun 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ember-testing/lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions packages/ember-testing/lib/helpers/pause_test.js
Original file line number Diff line number Diff line change
@@ -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');
}
7 changes: 5 additions & 2 deletions packages/ember-testing/tests/helpers_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down