This is slightly less complicated than T89432. Although it, too, requires a fair amount of refactoring to make our code more testable.
The goal is to be able to run QUnit when merely loading:
- base modules (jQuery + mediawiki.js)
- modules marked as dependencies by test suites.
- registered test suites.
See also:
T89432: Make PHPUnit tests run without installing MediaWiki