sindresorhus / gulp-mocha

Run Mocha tests
MIT License
375 stars 91 forks source link

Gulp-mocha doesn't pass reporterOptions #167

Closed vercruyssetim closed 7 years ago

vercruyssetim commented 7 years ago

The solution of #151 prevents reportOptions to be passed to mocha. The reason is that the dargs library doesn't handle nested objects and ignores the reporterOptions field.

Freundschaft commented 7 years ago

yes, seeing the same problem here, can you submit a PR?

sindresorhus commented 7 years ago

There's no common way of handling nested objects on the command-line. Different tools handles it in different ways. I think it would be better to just add support for it here. This plugin already handles array arguments, so shouldn't be hard to add support for object too. See: https://github.com/sindresorhus/gulp-mocha/blob/e8780864a9895fb8aa4d7b252852d8018d72a89c/index.js#L18-L24

Pull request welcome :)


For now, you can just pass an array in this format: ['k=v', 'k=v'].