Esanders has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/351107 )
Change subject: Avoid global variables in tests and build
......................................................................
Avoid global variables in tests and build
Change-Id: I44dd3c3980f88e660798962c4aa0229b62760796
---
M Gruntfile.js
M
modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js
2 files changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/07/351107/1
diff --git a/Gruntfile.js b/Gruntfile.js
index e13d0ef..2e6bd55 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -14,7 +14,7 @@
timeout: 40000,
require: [
function () {
- // eslint-disable-next-line no-undef
+ // eslint-disable-next-line no-undef,
no-implicit-globals
langs = [ 'en' ];
}
]
@@ -24,7 +24,7 @@
timeout: 40000,
require: [
function () {
- // eslint-disable-next-line no-undef
+ // eslint-disable-next-line no-undef,
no-implicit-globals
langs = require(
'./build/tasks/screenshotLangs.json' ).langs;
}
]
diff --git
a/modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js
b/modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js
index 08c9d90..f6eda3e 100644
---
a/modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js
+++
b/modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js
@@ -3,12 +3,13 @@
*
* @copyright 2011-2017 VisualEditor Team and others; see
http://ve.mit-license.org
*/
-var MWWIKITEXT_MOCK_API = true;
+
+window.MWWIKITEXT_MOCK_API = true;
QUnit.module( 've.ui.MWWikitextStringTransferHandler', QUnit.newMwEnvironment(
{
setup: function () {
// Mock XHR for mw.Api()
- this.server = MWWIKITEXT_MOCK_API ?
this.sandbox.useFakeServer() : null;
+ this.server = window.MWWIKITEXT_MOCK_API ?
this.sandbox.useFakeServer() : null;
ve.test.utils.mwEnvironment.setup.call( this );
},
teardown: ve.test.utils.mwEnvironment.teardown
--
To view, visit https://gerrit.wikimedia.org/r/351107
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I44dd3c3980f88e660798962c4aa0229b62760796
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits