We have a use case in which the Cite extension includes an optional ResourceLoader module ext.cite.referencePreviews which runs as a plugin to Popups. From a production perspective, this is perfectly safe because the module is only ever loaded by Popups. However, our QUnit tests are problematic because dependencies are "hard" and must be declared statically. If we don't list the Popups-dependent module as a dependency, then it seems to be impossible to load this module from our tests. If we do list the dependency, then the tests crash during the gated extension run where Popups is not loaded. Adding Popups to the gated extensions would be the least desirable workaround.
Potential workarounds:
- Define a new module whose only purpose is to wrap the glue module in a soft way. The dependencies of this module would have to be dynamically modifiable from a PHP hook in the extension.
- Introduce a mechanism for modifying QUnitTestModules.dependencies at run-time.
- Find a way of loading RL modules not specified in dependencies.
- Only run the glue tests manually, with a separate package.json target.