danielstjules/mocha.parallel

Support descriptions for hooks like mocha

Closed this issue · 1 comments

Mocha supports the ability to describe hooks as well.
This is not very well documented on their main documentation page but it is possible, as can be seen here https://github.com/mochajs/mocha/blob/2bb2b9fa35818db7a02e5068364b0c417436b1af/lib/suite.js#L200.
Doing this in mocha.parallel will throw an error because at this line: https://github.com/danielstjules/mocha.parallel/blob/master/lib/parallel.js#L243 the hooks will only take one argument, namely the function. It will then attempt to execute the description string which throws an error.

Thanks for the issue! Workaround here to prevent the code from throwing an exception: 068eaae If interested, would welcome PRs to fully support named hooks, though I don't see a ton of benefit.