The config variable itself and the documentation property were added
in MediaWiki 1.19 (r107919 /
c447423593).
The testswarm-injectjs propert was added in MediaWiki 1.20 (
5e590be3d6).
We never actually ended up using TestSwarm, and this variable
is not used anywhere I can see.
Having a configuration variable for a documentation page seems
odd. I can't find another instance of this. As it's tied to development
(not for users of the wiki), link to mediawiki.org direcly.
Change-Id: Ib16607683a293b6d6661ed0411dad9a3ff551a08
* $wgPageShowWatchingUsers was removed.
* $wgLocalVirtualHosts has been added to replace $wgConf->localVHosts.
* $wgAntiLockFlags was removed.
+* $wgJavaScriptTestConfig was removed.
* Edit tokens returned from User::getEditToken may change on every call. Token
validity must be checked by passing the user-supplied token to
User::matchEditToken rather than by testing for equality with a
*/
$wgEnableJavaScriptTest = false;
-/**
- * Configuration for javascript testing.
- */
-$wgJavaScriptTestConfig = array(
- 'qunit' => array(
- // Page where documentation can be found relevant to the QUnit test suite being ran.
- // Used in the intro paragraph on [[Special:JavaScriptTest/qunit]] for the
- // documentation link in the "javascripttest-qunit-intro" message.
- 'documentation' => '//www.mediawiki.org/wiki/Manual:JavaScript_unit_testing',
- // If you are submitting the QUnit test suite to a TestSwarm instance,
- // point this to the "inject.js" script of that instance. This is was registers
- // the QUnit hooks to extract the test results and push them back up into the
- // TestSwarm database.
- // @example 'http://localhost/testswarm/js/inject.js'
- // @example '//integration.mediawiki.org/testswarm/js/inject.js'
- 'testswarm-injectjs' => false,
- ),
-);
-
/**
* Overwrite the caching key prefix with custom value.
* @since 1.19
*/
private function initQUnitTesting() {
$out = $this->getOutput();
- $testConfig = $this->getConfig()->get( 'JavaScriptTestConfig' );
$out->addModules( 'test.mediawiki.qunit.testrunner' );
$qunitTestModules = $out->getResourceLoader()->getTestModuleNames( 'qunit' );
$out->addModules( $qunitTestModules );
$summary = $this->msg( 'javascripttest-qunit-intro' )
- ->params( $testConfig['qunit']['documentation'] )
+ ->params( 'https://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing' )
->parseAsBlock();
$header = $this->msg( 'javascripttest-qunit-heading' )->escaped();
$userDir = $this->getLanguage()->getDir();
$out->addHtml( $this->wrapSummaryHtml( $summary, 'frameworkfound' ) . $baseHtml );
// This special page is disabled by default ($wgEnableJavaScriptTest), and contains
- // no sensitive data. In order to allow TestSwarm to embed it into a test client window,
+ // no sensitive data. In order to allow test frameworks to embed it into a test client window,
// we need to allow iframing of this page.
$out->allowClickjacking();
-
- // Used in ./tests/qunit/data/testrunner.js, see also documentation of
- // $wgJavaScriptTestConfig in DefaultSettings.php
- $out->addJsConfigVars(
- 'QUnitTestSwarmInjectJSPath',
- $testConfig['qunit']['testswarm-injectjs']
- );
}
/**
// and assuming failure.
QUnit.config.testTimeout = 30 * 1000;
+ QUnit.config.requireExpects = true;
+
// Add a checkbox to QUnit header to toggle MediaWiki ResourceLoader debug mode.
QUnit.config.urlConfig.push( {
id: 'debug',
tooltip: 'Enable debug mode in ResourceLoader'
} );
- QUnit.config.requireExpects = true;
-
- /**
- * Load TestSwarm agent
- */
- // Only if the current url indicates that there is a TestSwarm instance watching us
- // (TestSwarm appends swarmURL to the test suites url it loads in iframes).
- // Otherwise this is just a simple view of Special:JavaScriptTest/qunit directly,
- // no point in loading inject.js in that case. Also, make sure that this instance
- // of MediaWiki has actually been configured with the required url to that inject.js
- // script. By default it is false.
- if ( QUnit.urlParams.swarmURL && mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) {
- jQuery.getScript( QUnit.fixurl( mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) );
- }
-
/**
* CompletenessTest
*