Freewind Freewind - 1 year ago 121
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.

Answer Source

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')