title: Passing variables down Mocha test suites
body: <p>I am creating a connection (and cleaning up a database) with mongoose before running all tests with mocha like so (_setup.js):</p>
  
  <pre><code>var mongoose = require('mongoose'),
  nconf = require('nconf');
  
  nconf.env().argv(); 
  
  var _conn;
  
  before(function(done){
      _conn = mongoose.createConnection(nconf.get('TEST_DB'), function(error){
        if(error) return done(error);
  
        _conn.db.dropDatabase(done);
     });
  });
  
  after(function(done){
     _conn.db.dropDatabase(function(error){
         if(error) return done(error);
  
         _conn.close(done);
     });
  });
  </code></pre>
  
  <p>Other test suites need this connection to build the mongoose models. I am using a separate connection instead of the default mongoose connection because these tests can be run in app through the mocha js api. The app uses the default mongoose connection. Example test needing connection variable:</p>
  
  <pre><code>var should = require('should'),
  service = require('../lib/service')(_conn); // &lt;&lt; somehow need that conn variable created in before tests
  
  describe('Service', function(){
  
     describe('#dodboperation()', function(){
  
         //tests and stuff
  </code></pre>
  
  <p>Is there anyway to pass variables between files/test suites in mocha? Suggestions?</p>