I am trying to run multiple js tests using mocha.  I want to match on filenames using a regex, but according to the documentation you can only use a regex to match on describe blocks.  All of my spec files are named *.spec.js, so I would assume I would be able to run just those files easily.  Is there a way/plugin that I can match on the filenames that end in .spec.js?
You can pass a glob expression to mocha like this:
mocha *.spec.js
If you do not specify a glob it defaults to mocha test/*.js.
The regexp you are refering to is the "grep" option which works on test names.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With