From 3dbfd49793a479efb2fb8b968ccb7f4902287b67 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 5 Feb 2014 12:32:01 -0800 Subject: [PATCH] qunit: Preserve context in QUnit module environment override They were being called as properties of localEnv, which is a shallow copy of the real one. When other callbacks add properties to the object, they weren't visible in the local "this" of the module teardown/setup. Change-Id: I01e2031e1e2bfcedc7aa3480ce7d9915c8fff7f1 --- 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 5bdd37f552..50e6014c0a 100644 --- a/tests/qunit/data/testrunner.js +++ b/tests/qunit/data/testrunner.js @@ -150,14 +150,14 @@ mw.config.values = freshConfigCopy( localEnv.config ); mw.messages.values = freshMessagesCopy( localEnv.messages ); - localEnv.setup(); + localEnv.setup.call( this ); }, teardown: function () { log( 'MwEnvironment> TEARDOWN for "' + QUnit.config.current.module + ': ' + QUnit.config.current.testName + '"' ); - localEnv.teardown(); + localEnv.teardown.call( this ); // Farewell, mock environment! mw.config.values = liveConfig; -- 2.20.1