resourceloader: Don't explicitly enqueue test libs on SpecialJavaScriptTest
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 30 Jul 2019 15:06:35 +0000 (16:06 +0100)
committerKrinkle <krinklemail@gmail.com>
Tue, 30 Jul 2019 16:00:49 +0000 (16:00 +0000)
commit5f47d994bc72ad13c5483237d39d891e1591f57b
tree10fcc21390761ac8154aa5886190a0a04b39a265
parentff391bba34980cc8079744db285f64c2c6d1fa17
resourceloader: Don't explicitly enqueue test libs on SpecialJavaScriptTest

The test-only modules registered by QUnitTestResources.php are currently
were previously caught by the array_keys() catch-all in registerTestModules()
which meant that modules like 'test.sinonjs' would be requested on
SpecialJavaScriptTest despite not doing anything by itself, nor executing
at the "right" time per se through this means.

In order for it to execute at the right time, the testrunner has to depend
on it (which it does, already). But, that also means it doesn't need to
be requested separately. Doing so could be confusing.

This is neccecary in order to move 'jquery.qunit' from Resources.php
to QUnitTestResources.php as otherwise, listing in QUnitTestResources.php,
would implicitly mean SpecialJavaScriptTest.php thinks it's a test suite
and load it. That is a problem, because when we run the tests headless from
the command-line with Karma, the environment already has a QUnit interface
defined, and should not be loaded a second time by MW.

Change-Id: I08b31cd1dee516cf0d26bafdb8cc7c1223633bad
includes/resourceloader/ResourceLoader.php
includes/specials/SpecialJavaScriptTest.php