title: Mocha with Grunt: Cannot find module that exists
body: <p>I am having issues with Mocha finding a module that exists. I have a data folder that contains all my test data. This folder exists and is at the correct directory (confirmed with pwd). When I run the test using mocha test <em>filename</em> the tests pass, but when I use <code>grunt test</code> I get the following error.</p>
  
  <pre><code>Running "mochaTest:tests" (mochaTest) task
  &gt;&gt; Mocha exploded!
  &gt;&gt; Error: Cannot find module '/Users/user/Documents/project/project_dispatcher/tests/data'
  &gt;&gt;     at Function.Module._resolveFilename (module.js:339:15)
  &gt;&gt;     at Function.Module._load (module.js:290:25)
  &gt;&gt;     at Module.require (module.js:367:17)
  &gt;&gt;     at require (internal/module.js:16:19)
  &gt;&gt;     at /Users/user/Documents/project/project_dispatcher/node_modules/mocha/lib/mocha.js:219:27
  &gt;&gt;     at Array.forEach (native)
  &gt;&gt;     at Mocha.loadFiles (/Users/user/Documents/project/project_dispatcher/node_modules/mocha/lib/mocha.js:216:14)
  &gt;&gt;     at MochaWrapper.run (/Users/user/Documents/project/project_dispatcher/node_modules/grunt-mocha-test/tasks/lib/MochaWrapper.js:51:15)
  &gt;&gt;     at /Users/user/Documents/project/project_dispatcher/node_modules/grunt-mocha-test/tasks/mocha-test.js:86:20
  &gt;&gt;     at capture (/Users/user/Documents/project/project_dispatcher/node_modules/grunt-mocha-test/tasks/mocha-test.js:33:5)
  Warning: Task "mochaTest:tests" failed. Use --force to continue.
  </code></pre>
  
  <p>I am assuming this is a config issue, but I am lost as to what is causing it. I have the following structure:</p>
  
  <p>->test</p>
  
  <p>-->testfile.js</p>
  
  <p>-->data</p>
  
  <p>---->datafile.json</p>
  
  <p>And I include the json file using: </p>
  
  <pre><code>var requestObj = require('./data/workflowRequest.json');
  </code></pre>
  
  <p>Is the ./ no longer valid because I am using Grunt which is located above the test folder? I am also confused because the stack trace only contains mocha files, and no test files that I wrote.</p>
  
  <p><strong>Edit</strong> Grunt code may be useful too</p>
  
  <pre><code>mochaTest: {
      tests: {
          src:['tests/**/*'],
          options: {
              reporter: 'spec'
          }
      },
      watch: {
          src:['tests/**/*'],
          options: {
              reporter: 'nyan'
          }
      },
      tap: {
          src:['tests/**/*'],
          options: {
              reporter: 'tap'
          }
      }
  },
  </code></pre>