If I define a QUnit RL module like so:
"QUnitTestModule": { "localBasePath": "", "remoteExtPath": "CampaignEvents", "scripts": [ "tests/qunit/index.js" ] },
And then, in tests/qunit/index.js, I have
'use strict'; require( './foo.test.js' );
The test runner will fail with a nonsensical error message:
Chrome Headless 133.0.0.0 (Linux x86_64) LOG: 'Exception in module-execute in module test.CampaignEvents:'
Chrome Headless 133.0.0.0 (Linux x86_64) WARN: Error: Module "." is not loaded
Error: Module "." is not loaded
at require (http://localhost:8080/w2/index.php?title=Special:JavaScriptTest/qunit/export&component=CampaignEvents:19:962)
at http://localhost:8080/w2/load.php?modules=jquery.client%7Cmediawiki.String%2CTitle%2Capi%2Ccldr%2Ccookie%2CjqueryMsg%2Clanguage%2Cqunit-testrunner%2Cuser%2Cutil%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%7Csinonjs%7Ctest.CampaignEvents&version=qg4q0:270:109
at runScript (http://localhost:8080/w2/index.php?title=Special:JavaScriptTest/qunit/export&component=CampaignEvents:11:580)
at execute (http://localhost:8080/w2/index.php?title=Special:JavaScriptTest/qunit/export&component=CampaignEvents:13:107)
at doPropagation (http://localhost:8080/w2/index.php?title=Special:JavaScriptTest/qunit/export&component=CampaignEvents:5:920)The problem is that I'm using require in a module that uses scripts instead of packageFiles, but saying that Module "." is not loaded is arguably not the best way to let a developer know.