Skip to content

Commit

Permalink
Merge pull request #292 from emberjs/make-setup-teardown-async
Browse files Browse the repository at this point in the history
Make `setupTest` and `setupRenderingTest` async.
  • Loading branch information
rwjblue authored Nov 5, 2017
2 parents 09e5cc8 + 98d71aa commit fe9b463
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions addon-test-support/ember-qunit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@ import {

export function setupTest(hooks, options) {
hooks.beforeEach(function(assert) {
setupContext(this, options);

let originalPauseTest = this.pauseTest;
this.pauseTest = function QUnit_pauseTest() {
assert.timeout(-1); // prevent the test from timing out

return originalPauseTest.call(this);
};
return setupContext(this, options).then(() => {
let originalPauseTest = this.pauseTest;
this.pauseTest = function QUnit_pauseTest() {
assert.timeout(-1); // prevent the test from timing out

return originalPauseTest.call(this);
};
});
});

hooks.afterEach(function() {
teardownContext(this);
return teardownContext(this);
});
}

export function setupRenderingTest(hooks, options) {
setupTest(hooks, options);

hooks.beforeEach(function() {
setupRenderingContext(this);
return setupRenderingContext(this);
});

hooks.afterEach(function() {
teardownRenderingContext(this);
return teardownRenderingContext(this);
});
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"common-tags": "^1.4.0",
"ember-cli-babel": "^6.3.0",
"ember-cli-test-loader": "^2.2.0",
"ember-test-helpers": "^0.7.0-beta.9",
"ember-test-helpers": "^0.7.0-beta.10",
"qunitjs": "^2.4.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2133,9 +2133,9 @@ ember-source@~2.15.0:
simple-dom "^0.3.0"
simple-html-tokenizer "^0.4.1"

ember-test-helpers@^0.7.0-beta.9:
version "0.7.0-beta.9"
resolved "https://registry.yarnpkg.com/ember-test-helpers/-/ember-test-helpers-0.7.0-beta.9.tgz#f1272d78821d988946d3d25dcf2cac81d3e79918"
ember-test-helpers@^0.7.0-beta.10:
version "0.7.0-beta.10"
resolved "https://registry.yarnpkg.com/ember-test-helpers/-/ember-test-helpers-0.7.0-beta.10.tgz#d14fb1feb469e2943d3f852423f152efa0a9a4aa"
dependencies:
broccoli-funnel "^2.0.1"
ember-cli-babel "^6.8.1"
Expand Down

0 comments on commit fe9b463

Please sign in to comment.