mocha not running all tests in test dir

Yoni Levy picture Yoni Levy · Jan 7, 2016 · Viewed 11.3k times · Source

This is my folder structure

src/
   a.js
   b.js
   test/
     a.spec.js
     b.spec.js

and I've tried running

  1. ~/.../src $ mocha
  2. ~/.../src $ mocha test
  3. ~/.../src $ mocha test/
  4. ~/.../src $ mocha ./test/
  5. ~/.../src $ mocha ./test/*.js

but non worked... all I get is just one test file running and the rest are ignored.

The docs say that (1) should do the job but well it doesn't.

Answer

Yoni Levy picture Yoni Levy · Jan 7, 2016

Well... I'm an idiot. I had it.only in one of my files and I forgot it. Removing the .only was the answer. All the test files are running now.

Sorry for that, shame on me...