From cfd20e5a832e7d324cb2f081a48bfa18e3f79a33 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Sun, 11 Sep 2016 12:53:14 -0400 Subject: [PATCH] Prevent calling `QUnit.start` twice with jQuery 3.0. Under jQuery 3.0 `$.ready` is always async (even if the document is already loaded). This is generally a great thing, however we were relying on the fact that it was sync (then adding our own async to ensure it was async). This change prevents QUnit from auto-starting until our callback is completed. --- vendor/ember-cli-qunit/test-loader.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor/ember-cli-qunit/test-loader.js b/vendor/ember-cli-qunit/test-loader.js index 58056582..f52b0dce 100644 --- a/vendor/ember-cli-qunit/test-loader.js +++ b/vendor/ember-cli-qunit/test-loader.js @@ -13,6 +13,9 @@ document.addEventListener('DOMContentLoaded', fn); } } + + var autostart = QUnit.config.autostart !== false; + QUnit.config.autostart = false; ready(function() { var QUnitAdapter = require('ember-qunit').QUnitAdapter; @@ -64,9 +67,6 @@ } }); - var autostart = QUnit.config.autostart !== false; - QUnit.config.autostart = false; - setTimeout(function() { TestLoader.load();