diff --git a/core-comment-top.js b/core-comment-top.js index 05a2c55..de66169 100644 --- a/core-comment-top.js +++ b/core-comment-top.js @@ -1,20 +1,20 @@ -/* _______________________________________________________________________________ - * | | - * | === WARNING: GLOBAL GADGET FILE === | - * | Changes to this page affect many users. | - * | Please discuss changes on the talk page or on [[WT:Gadget]] before editing. | - * |_______________________________________________________________________________| - * - * Built from source code at GitHub repository [https://github.com/wikimedia-gadgets/xfdcloser] - * All changes should be made in the repository, otherwise they will be lost. - * - * To update this script from github, you must have a local repository set up. Then - * follow the instructions at [https://github.com/wikimedia-gadgets/xfdcloser/blob/master/README.md] - * - * XFDcloser: close deletion discussions at XfD venues, including actions to implement closes; see [[WP:XFDC]] - * Author: Evad37 - * Licencing and attribution: [[WP:XFDC#Licencing and attribution]] - */ -/* jshint esversion: 5, esnext:false, laxbreak: true, undef: true, eqnull: true, maxerr: 3000 */ -/* globals console, document, window, $, mw, OO */ +/* _______________________________________________________________________________ + * | | + * | === WARNING: GLOBAL GADGET FILE === | + * | Changes to this page affect many users. | + * | Please discuss changes on the talk page or on [[WT:Gadget]] before editing. | + * |_______________________________________________________________________________| + * + * Built from source code at GitHub repository [https://github.com/wikimedia-gadgets/xfdcloser] + * All changes should be made in the repository, otherwise they will be lost. + * + * To update this script from github, you must have a local repository set up. Then + * follow the instructions at [https://github.com/wikimedia-gadgets/xfdcloser/blob/master/README.md] + * + * XFDcloser: close deletion discussions at XfD venues, including actions to implement closes; see [[WP:XFDC]] + * Author: Evad37 + * Licencing and attribution: [[WP:XFDC#Licencing and attribution]] + */ +/* jshint esversion: 5, esnext:false, laxbreak: true, undef: true, eqnull: true, maxerr: 3000 */ +/* globals console, document, window, $, mw, OO */ /* */ \ No newline at end of file diff --git a/globals-src/node.js b/globals-src/node.js index b9d3e63..70aadcb 100644 --- a/globals-src/node.js +++ b/globals-src/node.js @@ -11,7 +11,7 @@ const OO = require("oojs"); OO.ui = { HtmlSnippet: function(content) { this.content = content; }, MessageDialog: function(content) { this.content = content; } -} +}; global.window = window; // Set up mock mw object (with just enough to get tests running without errors) @@ -23,7 +23,7 @@ const mw = { }, Api: () => {}, util: { - escapeRegExp: function(str){return str.replace(/([\\{}()|.?*+\-^$\[\]])/g,'\\$1');} + escapeRegExp: function(str){return str.replace(/([\\{}()|.?*+\-^$[\]])/g,"\\$1");} } };