User "Reedy" posted a comment on MediaWiki.r100392.
Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100392#c24633
Commit summary:
[JSTesting] Initial stab at implementing on-wiki running of unit tests with
QUnit.
* Using a SpecialPage, Special:JavaScriptTest
* Disabled by default (both because it's a new feature and because tests can
potentially make edits or do bad stuff not wanted on a production wiki)
* Extensions can register a test suite by registering their test suite as a
regular module (e.g. 'ext.fooBar.test'), with a dependency on the module(s)
being tested.
<code>
$wgHooks['ResourceLoaderTestModules'][] =
'FooBarHooks::resourceLoaderTestModules';
--- FooBar.hooks.php
public static function resourceLoaderTestModules( &$testModules,
$resourceLoader ) {
&$testModules['qunit']['ext.fooBar.test'] = array(
'scripts' => 'resources/ext.fooBar.test.js',
'dependencies' => array(
'ext.fooBar.editor',
'ext.fooBar.api',
),
'remoteExtPath' => 'FooBar',
'localBasePath' => __DIR__,
);
return true;
}
</code>
* MFT r100386
Comment:
svn:eol-style native
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview