HomePhabricator

SpecialJavaScriptTest: Bypass ResourceLoader 'target' scope

Authored by Krinkle.

Description

SpecialJavaScriptTest: Bypass ResourceLoader 'target' scope

To make unit testing easier, allow any module to be loaded within
the unit test suite. Regardless of the intended 'target'.

Targets are meant for restricting front-end scope in production.
Enforcing that in the test suite causes various test suites to
get de-registered at run time client-side.

Otherwise, in order to truly run all unit tests, Jenkins would
have to re-run the entire test suite in all known targets. This
wouldn't make sense because modules have to be globally uniquely
named (no conflicts) and unit tests are atomic. They can all run
in the same suite.

To prevent modules being comitted with incompatible target
dependencies, we already have a Structure test in the PHPUnit
suite to catch those issues in the module registry.

This makes the main 'qunit' build for MobileFrontend more useful,
where currently many modules aren't being tested due to them not
being in the 'desktop' target.

Bug: T103027
Change-Id: I69f735eb56c1362189298d9859d3add576faaadb