Skip to content

Commit 03bc252

Browse files
committed
Promote array arguments to arrays at the time they are retrieved
Waiting until they have been mixed into the config is too late when an argument can be an object. Fixes #491. (cherry picked from commit afd2570)
1 parent 852750d commit 03bc252

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/executors/PreExecutor.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ define([
105105
kwArgs = parseArgs.fromCommandLine(process.argv.slice(2));
106106
}
107107

108+
[ 'environments', 'functionalSuites', 'reporters', 'suites' ].forEach(function (name) {
109+
var value = kwArgs[name];
110+
if (value != null && !Array.isArray(value)) {
111+
kwArgs[name] = value === '' ? [] : [ value ];
112+
}
113+
});
114+
108115
this.getArguments = function () {
109116
return kwArgs;
110117
};
@@ -225,13 +232,6 @@ define([
225232
}
226233
}
227234

228-
[ 'environments', 'functionalSuites', 'reporters', 'suites' ].forEach(function (name) {
229-
var value = config[name];
230-
if (value != null && !Array.isArray(value)) {
231-
config[name] = value === '' ? [] : [ value ];
232-
}
233-
});
234-
235235
if (has('host-browser') && args.loaders && args.loaders['host-browser']) {
236236
util.assertSafeModuleId(args.loaders['host-browser']);
237237
}

0 commit comments

Comments
 (0)