AndyRussG has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/233654

Change subject: GeoIP tests: move saving of original values outside setup
......................................................................

GeoIP tests: move saving of original values outside setup

Setup is executed for every test. This patch moves the saving of original
geoIP values and cookie to the enclosing function.

Change-Id: Ied39fbbee29a94be44abb6558743ed1ee388cbf3
---
M tests/qunit/subscribing/ext.centralNotice.geoIP.tests.js
1 file changed, 4 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice 
refs/changes/54/233654/1

diff --git a/tests/qunit/subscribing/ext.centralNotice.geoIP.tests.js 
b/tests/qunit/subscribing/ext.centralNotice.geoIP.tests.js
index 0242327..435b5ed 100644
--- a/tests/qunit/subscribing/ext.centralNotice.geoIP.tests.js
+++ b/tests/qunit/subscribing/ext.centralNotice.geoIP.tests.js
@@ -13,18 +13,12 @@
                        lon: -104.887,
                        region: "CO"
                },
-               realAjax,
-               realCookie,
-               realDeferred,
-               realGeo;
+               realAjax = $.ajax,
+               realCookie = $.cookie( COOKIE_NAME ),
+               realDeferred = mw.geoIP.deferred,
+               realGeo = window.Geo;
 
        QUnit.module( 'ext.centralNotice.geoIP', QUnit.newMwEnvironment( {
-               setup: function () {
-                       realAjax = $.ajax;
-                       realCookie = $.cookie( COOKIE_NAME );
-                       realDeferred = mw.geoIP.deferred;
-                       realGeo = window.Geo;
-               },
                teardown: function () {
                        $.ajax = realAjax;
                        // This cookie is always set to '/' in prod and should 
be here too.

-- 
To view, visit https://gerrit.wikimedia.org/r/233654
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied39fbbee29a94be44abb6558743ed1ee388cbf3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: campaign_mixins
Gerrit-Owner: AndyRussG <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to