Freewind Freewind - 8 months ago 73
Node.js Question

How to specify test directory for mocha?

Mocha tries to find test files under

by default, how do I specify another dir, e.g.


Here's one way, if you have subfolders in your test folder e.g.


Then in linux you can use the find command to list all *.js files recursively and pass it to mocha:

mocha $(find test -name '*.js')