Description
Tell us about your runtime:
- QUnit version: 2.20.1
- Which environment are you using? (e.g., browser, Node): browser
- How are you running QUnit? (e.g., QUnit CLI, Grunt, Karma, manually in browser): manually in browser: currently in Chrome 121.0.6167.184 for macOS or Firefox 123.0 for macOS
What are you trying to do?
I'm trying to run tests for multiple modules by providing a URL directly, without initial UI interactions on my side.
Code that reproduces the problem:
In jQuery, we have multiple test modules. It is possible to choose them from the module dropdown which results in multiple moduleId
added to the URL. But you cannot compute those moduleIds in your mind easily since they are hashed.
QUnit supports specifying a module via the module
query parameter. In jQuery, we often use it to run tests divided by module on TestSwarm in CI.
I'd like to pass multiple modules via specifying the module
field directly multiple times. Example: ?module=support&module=basic
.
What did you expect to happen?
I expected ?module=support&module=basic
to run all the tests from the support
& basic
modules.
What actually happened?
Passing the module
parameter multiple times results in errors. If you e.g. pass ?module=support&module=basic
, you get an error:
qunit.js:3041 Uncaught TypeError: config.module.toLowerCase is not a function
at Test.valid (qunit.js:3041:59)
at new Test (qunit.js:2428:19)
at addTest (qunit.js:3116:19)
at Object.test (qunit.js:3133:5)
at ready.js:13:8
at ready.js:166:4
The error happens in the following line:
Line 835 in 8ea67f4
It happens because while in the ?module=support
case config.module
is "support"
, in the ?module=support&module=basic
case it's an array: ["support", "basic"]
.
I think this way of passing multiple modules worked in the past. Can we bring it back?