mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
Don't load entire codebase in QUnit tests
As noted in T160406, the only QUnit tests that requires a running MediaWiki instance is the test for mw.popups.processLinks. The function itself is isolated from the rest of the codebase. Now, as noted in T162876#3182198, during boot the ext.eventLogging.Schema module is loaded asynchronously with mw.loader.using. Since boot is unconditional and happens ASAP this happens when the tests are loaded and run. In the short term this can be avoided by not making the tests depend on the entire codebase. The long term solution is laid out in T160406. Supporting changes: * Bundle assets with webpack@2.4.1. Bug: T162876 Change-Id: If1ee1853ba7a9b2a66b24bb93b4e6062b92b0dba
This commit is contained in:
parent
83e32c255d
commit
d55e8b9a17
|
@ -119,20 +119,12 @@ class PopupsHooks {
|
|||
*/
|
||||
public static function onResourceLoaderTestModules( array &$testModules,
|
||||
ResourceLoader &$resourceLoader ) {
|
||||
$localBasePath = __DIR__ . '/..';
|
||||
$scripts = glob( "{$localBasePath}/tests/qunit/ext.popups/{,**/}*.test.js", GLOB_BRACE );
|
||||
$start = strlen( $localBasePath ) + 1;
|
||||
|
||||
$scripts = array_map( function ( $script ) use ( $start ) {
|
||||
return substr( $script, $start );
|
||||
}, $scripts );
|
||||
|
||||
$testModules['qunit']['ext.popups.tests'] = [
|
||||
'scripts' => $scripts,
|
||||
'dependencies' => [
|
||||
'ext.popups'
|
||||
'scripts' => [
|
||||
'tests/qunit/ext.popups/processLinks.test.js',
|
||||
'src/processLinks.js',
|
||||
],
|
||||
'localBasePath' => $localBasePath,
|
||||
'localBasePath' => __DIR__ . '/..',
|
||||
'remoteExtPath' => 'Popups',
|
||||
];
|
||||
}
|
||||
|
|
BIN
resources/dist/index.js
vendored
BIN
resources/dist/index.js
vendored
Binary file not shown.
BIN
resources/dist/index.js.map
vendored
BIN
resources/dist/index.js.map
vendored
Binary file not shown.
Loading…
Reference in a new issue