title: Mocha test scripts in sub-directories are executed locally, but ignored in CircleCI
body: <p>To me, it looks like mocha's <code>--recursive</code> flag is working correctly on my machine, but being ignored during CI automated testing.  This means that only 60 tests are executed in CircleCI, but ~100 are executed when I run <code>npm test</code> on my machine.</p>
  
  <p><strong>Partial Project Structure</strong></p>
  
  <pre><code>|--/test
  |----mocha.opts
  |----lifecycle.test.js
  |----/integration
  |------/models
  |--------Thing.test.js
  |------/controllers
  |--------/thing
  |----------thingAction.test.js
  |--/.circleci
  |----config.yml
  </code></pre>
  
  <p><strong>mocha.opts</strong></p>
  
  <pre><code>--recursive
  --timeout 20000
  --reporter list
  --exit
  </code></pre>
  
  <p><strong>.circleci/config.yml</strong></p>
  
  <pre><code># Javascript Node CircleCI 2.0 configuration file
  #
  # Check https://circleci.com/docs/2.0/language-javascript/ for more details
  #
  version: 2
  jobs:
    build:
      docker:
        # specify the version you desire here
        - image: circleci/node:8.11
  
        # Specify service dependencies here if necessary
        # CircleCI maintains a library of pre-built images
        # documented at https://circleci.com/docs/2.0/circleci-images/
        # - image: circleci/mongo:3.4.4
  
      working_directory: ~/repo
  
      steps:
        - checkout
  
        # Download and cache dependencies
        - restore_cache:
            keys:
            - v1-dependencies-{{ checksum "package.json" }}
            # fallback to using the latest cache if no exact match is found
            - v1-dependencies-
  
        - run: yarn install
  
        - save_cache:
            paths:
              - node_modules
            key: v1-dependencies-{{ checksum "package.json" }}
  
        # run tests!
        - run: yarn test
  </code></pre>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>"devDependencies": {
    "mocha": "^5.2.0",
  },
  "scripts": {
    "test": "npm run lint &amp;&amp; npm run mocha-tests &amp;&amp; echo 'Done.'",
    "lint": "eslint . --max-warnings=0 --report-unused-disable-directives &amp;&amp; echo 'Your .js files look so good.' &amp;&amp; lesshint assets/styles/ --max-warnings=0 &amp;&amp; echo 'Your .less files look good, too.'",
    "mocha-tests": "node ./node_modules/mocha/bin/mocha test/lifecycle.test.js test/integration/**/*.test.js",
  }
  </code></pre>
  
  <p>In this example, both <code>Thing.test.js</code> and <code>thingAction.test.js</code> are being executed localy, but only <code>Thing.test.js</code> is executed during the CircleCI build. Put another way, <code>test/integration/**/*.test.js</code> matches both file names locally, but only the top subdirectory in CircleCI.</p>
  
  <p><strong>How do I make sure all the test scripts get run?</strong></p>