diff --git a/resources/dist/index.js b/resources/dist/index.js index dd19b6fe0..b64065277 100644 Binary files a/resources/dist/index.js and b/resources/dist/index.js differ diff --git a/resources/dist/index.js.map b/resources/dist/index.js.map index b03c9a67c..98ffab183 100644 Binary files a/resources/dist/index.js.map and b/resources/dist/index.js.map differ diff --git a/src/processLinks.js b/src/processLinks.js index 2555817e2..c2c6e8459 100644 --- a/src/processLinks.js +++ b/src/processLinks.js @@ -4,7 +4,7 @@ var mw = window.mediaWiki, $ = jQuery, - getTitle = require( './getTitle' ); + getTitle = require( './title' ).getTitle; /** * Processes and returns link elements (or "``s") that are eligible for diff --git a/src/getTitle.js b/src/title.js similarity index 94% rename from src/getTitle.js rename to src/title.js index 524b021a3..fddaf10fd 100644 --- a/src/getTitle.js +++ b/src/title.js @@ -1,5 +1,5 @@ /** - * @module getTitle + * @module title */ var mw = window.mediaWiki; @@ -44,4 +44,6 @@ function getTitle( href, config ) { return undefined; } -module.exports = getTitle; +module.exports = { + getTitle: getTitle +}; diff --git a/tests/node-qunit/processLinks.test.js b/tests/node-qunit/processLinks.test.js index c396c3817..2620513fd 100644 --- a/tests/node-qunit/processLinks.test.js +++ b/tests/node-qunit/processLinks.test.js @@ -6,7 +6,7 @@ var mock = require( 'mock-require' ), QUnit.module( 'ext.popups/processLinks', { beforeEach: function () { this.getTitle = this.sandbox.stub().throws( 'UNIMPLEMENTED' ); - mock( '../../src/getTitle', this.getTitle ); + mock( '../../src/title', { getTitle: this.getTitle } ); processLinks = mock.reRequire( '../../src/processLinks' ); this.$container = $( '
' ); @@ -21,7 +21,7 @@ QUnit.module( 'ext.popups/processLinks', { }; }, afterEach: function () { - mock.stop( '../../src/getTitle' ); + mock.stop( '../../src/title' ); window.mediaWiki.Title = null; } } ); diff --git a/tests/node-qunit/getTitle.test.js b/tests/node-qunit/title.test.js similarity index 96% rename from tests/node-qunit/getTitle.test.js rename to tests/node-qunit/title.test.js index f7e8e86c2..a83c82f17 100644 --- a/tests/node-qunit/getTitle.test.js +++ b/tests/node-qunit/title.test.js @@ -1,8 +1,8 @@ -var getTitle = require( '../../src/getTitle' ); +var getTitle = require( '../../src/title' ).getTitle; /* global Map */ -QUnit.module( 'getTitle', { +QUnit.module( 'title#getTitle', { beforeEach: function () { this.config = new Map(); this.config.set( 'wgArticlePath', '/wiki/$1' );