title: require.main.require works but not inside Mocha test
body: <p>I have written a global function for requiring certain files of my app/framework:</p>
  
  <pre><code>global.coRequireModel = function(name) {
      // CRASH happens here
      return require.main.require('./api/_co' + name + '/_co' + name + '.model');
  }
  </code></pre>
  
  <p>This module is in /components/coGlobalFunctions.</p>
  
  <p>It is required in my main app app.js like this:</p>
  
  <pre><code>require('./components/coGlobalFunctions');
  </code></pre>
  
  <p>Then in other modules using "something" from the framework I use:</p>
  
  <pre><code>var baseScheme = coRequireModel('Base');
  </code></pre>
  
  <p>This works but not in the Mocha tests which give me a "Error: Cannot find module" right before the require.main.require call.</p>
  
  <p>It seems that the test is coming from another source folder. But I thought the require.main.require would take out the aspect of having to relatively linking to modules.</p>
  
  <p>EDIT:</p>
  
  <p>An example test file living in api/user:</p>
  
  <pre><code>var should = require('should');
  var app = require('../../app');
  var User = require('./user.model');
  ...
  </code></pre>