title: How can mocha recursively search my `src` folder for a specific filename pattern?
body: <p>In my npm package, I would like to emulate the pattern Meteor follows: a source file (named <code>client.js</code>) has a test file (named <code>client.tests.js</code>) live in a <code>src/</code> folder. Tests run with the <code>npm test</code> command. </p>
  
  <p>I'm following the usage docs to the 't'. I do not want to use a <code>find</code> in my package test command.</p>
  
  <ol>
  <li><p>I understand that mocha can recursively execute tests:</p>
  
  <p>mocha --recursive</p></li>
  <li><p>I understand that mocha can execute tests in a specific subfolder using the <code>--recursive</code> flag:</p>
  
  <p>mocha src --recursive</p></li>
  <li><p>I also understand that I can specify a glob to filter files by passing <code>*.tests.js</code>:</p>
  
  <p>mocha *.tests.js</p></li>
  </ol>
  
  <p>But, I want all three. I want mocha to test only files ending in <code>tests.js</code> in the src folder, recursively checking subdirectories.</p>
  
  <pre><code>mocha --recursive *.tests.js
  
  // See the files?
  $ &gt; ll ./src/app/
  total 168
  -rw-r--r--  ... client.js
  -rw-r--r--  ... client.tests.js
  
  // Option A
  $ &gt; mocha --recursive *.tests.js
  Warning: Could not find any test files matching pattern: *.tests.js
  No test files found
  
  // Option B
  $ &gt; mocha *.tests.js --recursive
  Warning: Could not find any test files matching pattern: *.tests.js
  No test files found.
  
  // Option C
  $ &gt; mocha --recursive src/app/*.tests.js
  3 passing (130ms)
  3 failing
  </code></pre>
  
  <p>So... </p>
  
  <ol>
  <li>Why is mocha not picking up the <code>*.tests.js</code> files in the subfolders? </li>
  <li>Why DOES it work if I specify the full path to the file?</li>
  <li>How do I make it work as desired?</li>
  </ol>