title: Mongoose save working in app but not in Mocha
body: <p>I'm trying to write some basic unit tests for a project I'm working on as a learning experience and have run into something that has me stumped.</p>
  
  <p>Basically, I can run the code below in a standalone node application and the code creates the new DB and inserts the record as expected.  If I then take the same code and run it in a mocha test in node, I see mongod report a new connection, but no DB is created and no record is inserted (and no error is reported).</p>
  
  <p>Any ideas what is going on (the mongoose code is pulled directly from the mongoose website).</p>
  
  <p>Standalone Node App (server.js)</p>
  
  <pre><code>var mg = require( 'mongoose' );
  
  mg.connect( 'mongodb://localhost/cat_test' );
  
  var Cat = mg.model( 'Cat', { name: String } );
  var kitty = new Cat({ name: 'Zildjian' });
  kitty.save( function( err ){
      if ( err ){
          console.log( err );
      }
      process.exit();
  });
  </code></pre>
  
  <p>Mocha Test (test.js)</p>
  
  <pre><code>describe( 'Saving models', function(){
      it( 'Should allow models to be saved to the database', function(){
          var mg = require( 'mongoose' );
  
          mg.connect( 'mongodb://localhost/cat_test' );
  
          var Cat = mg.model( 'Cat', { name: String } );
          var kitty = new Cat({ name: 'Zildjian' });
          kitty.save( function( err ){
              if ( err ){
                  console.log( err );
              }
              done();
          });
      });
  });
  </code></pre>
  
  <p>Thoughts?  I'm guessing it's something very obvious that I'm overlooking but I'm stumped.</p>