From 3e59344c695ed6f57582bd111c8d898743753423 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 7 Jul 2015 15:46:32 +0100 Subject: [PATCH] qunit: Restore sinon.sandbox after teardown instead of before This was causing pending (mocked) XHR requests to sometimes be cleaned up prematurely. As a general rule, setup always calls its parent first. And teardown always calls its parent last. The inner callback runs within the scope of the outer one and should still have acces to the sinon mocks. Change-Id: Ic4d9243c04af73e529b689e650d35ddabaa7f4b9 --- tests/qunit/data/testrunner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js index 7c3d6991a6..b8283572fd 100644 --- a/tests/qunit/data/testrunner.js +++ b/tests/qunit/data/testrunner.js @@ -90,11 +90,11 @@ } }, teardown: function () { - this.sandbox.verifyAndRestore(); - if ( localEnv.teardown ) { localEnv.teardown.call( this ); } + + this.sandbox.verifyAndRestore(); } } ); }; -- 2.20.1