Skip to content

Commit 12d44db

Browse files
committed
Convert all arrays to comma separated lists for Mocha
1 parent fbcaf85 commit 12d44db

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ module.exports = opts => {
1010
suppress: false
1111
}, opts);
1212

13-
if (Array.isArray(opts.globals)) {
14-
// `globals` option should end up as a comma-separated list
15-
opts.globals = opts.globals.join(',');
13+
// Convert arrays into comma separated lists
14+
for (const key of Object.keys(opts)) {
15+
const val = opts[key];
16+
17+
if (Array.isArray(val)) {
18+
opts[key] = val.join(',');
19+
}
1620
}
1721

1822
const args = dargs(opts, {

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ gulp.task('default', () =>
4040

4141
#### options
4242

43-
Options are passed directly to the `mocha` binary, so you can use any its [command-line options](http://mochajs.org/#usage) in a camelCased form. Listed below are some of the more commonly used options:
43+
Options are passed directly to the `mocha` binary, so you can use any its [command-line options](http://mochajs.org/#usage) in a camelCased form. Arrays are correctly converted to the comma separated list format Mocha expects. Listed below are some of the more commonly used options:
4444

4545

4646
##### ui

0 commit comments

Comments
 (0)