How can I tell Mocha
where to look for my test files? My test files dont reside in the standard project root ./test
folder. My test sit in Modules/.*/Tests/
.
I've attempted to use the --grep
command line argument but I have a feeling this argument looks for test NAMES not for test FILE NAMES.
mocha --grep
Modules\/.*\/Tests
The above command gives the error:
Warning: Could not find any test files matching pattern: test
No test files found
You have to match not only directory but also its files . Besides, do no need grep , use only --
:
mocha -- Modules/**/Tests/*.js
// or `mocha -- Modules/Tests/*.js` (I am not sure because you didn't give the project hierarchy )
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