From 98d71aa6dac6effcbbf5da2f37134aa8f2720cf8 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Sun, 5 Nov 2017 11:05:43 -0500 Subject: [PATCH] Make `setupTest` and `setupRenderingTest` async. --- addon-test-support/ember-qunit/index.js | 22 +++++++++++----------- package.json | 2 +- yarn.lock | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/addon-test-support/ember-qunit/index.js b/addon-test-support/ember-qunit/index.js index 09900e8e..92a97c32 100644 --- a/addon-test-support/ember-qunit/index.js +++ b/addon-test-support/ember-qunit/index.js @@ -26,18 +26,18 @@ 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); }); } @@ -45,11 +45,11 @@ export function setupRenderingTest(hooks, options) { setupTest(hooks, options); hooks.beforeEach(function() { - setupRenderingContext(this); + return setupRenderingContext(this); }); hooks.afterEach(function() { - teardownRenderingContext(this); + return teardownRenderingContext(this); }); } diff --git a/package.json b/package.json index 84d23885..3023031c 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/yarn.lock b/yarn.lock index 44176167..5dcf57bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"