AlekseyDanchin
AlekseyDanchin

Reputation: 310

Mocha. Test several test.js

I have some architecture:

NameOfModule |- module1 | |- file1.js | |- file2.js | |- test.js | |- module2 |- file1.js |- file2.js |- test.js

etc.

I know how I can run the one test.js. I'm simple run in terminal:

:~$ mocha

But I want to run all test.js files from root directory NameOfModule. How can I do it from terminal? What is it command?

I have Lubuntu 14.10.

Upvotes: 0

Views: 61

Answers (1)

Louis
Louis

Reputation: 151401

You can give mocha the list of files you want it to load so, with sh or bash as your shell:

$ mocha `find . -name test.js`

The find command finds all files named test.js. The backticks make it so that the output of find is passed as arguments to mocha.

Upvotes: 1

Related Questions