title: Mocha test hangs when comparing mongoose object with an object
body: <p>I'm using <code>mocha</code> and <code>chai</code> (with <code>chai-as-promised</code>) and I'm trying to test a mongoDB database using <code>mockgoose</code>.</p>
  
  <p>The model:</p>
  
  <pre><code>var Campaign = new Schema({
      //Schema here 
  });
  
  Campaign.statics.getOneById = function(id) {
      return this.findOne({_id: id }).populate('channels').populate('units');
  };
  </code></pre>
  
  <p>The code under test:</p>
  
  <pre><code>function getCampaignById(id) {
      return Campaign.getOneById(id);
  }
  </code></pre>
  
  <p>The test code:</p>
  
  <pre><code>var chai = require('chai'),
      chaiAsPromised = require('chai-as-promised'),
      mongoose = require('mongoose'),
      mockgoose = require('mockgoose'),
      Campaign = require('../src/campaigns/models/campaign-model'),
      Channel = require('../src/channels/models/channel-model'),
      Unit = require('../src/units/models/unit-model'),
      campaignRepo = require('../src/campaigns/lib/campaign-repository'),
      config = require('../scripts/services/config');
  
  chai.use(chaiAsPromised);
  chai.should();
  
  before(function(done) {
      mockgoose(mongoose).then(function() {
          mongoose.connect(config.db.dbStr, function(err) {
              done(err);
          })
      })
  });
  
  describe('Campaign repository', function() {
  
      var fullCampaign = {
          country: {
              dst:1,
              timezone:'+02:00',
              code:'AX',
              name:'Åland Islands'},
          name: 'This is campaign name',
          startDate:'2017-02-19T22:00:00.000Z',
          endDate:'2017-02-27T22:00:00.000Z',
          creatives: ['creative'],
          units:[],
          channels:[],
          money: {
              action: {
                  event: 'interaction_loaded',
                  label: 'View'
              },
              currency: {
                  code: 'USD',
                  sign: '$'
              },
              budget: 11111,
              costPerAction: 2
          }
      };
  
      var newCampaign;
  
      it('should create a new campaign', function() {
           campaignRepo.create(fullCampaign).then(function(createdCampaign) {
              newCampaign = createdCampaign;
          });
      });
  
      it('should get the new campaign from the database', function() {
          return (campaignRepo.getCampaignById(newCampaign._id)).should.eventually.equal(newCampaign);
      });
  });
  </code></pre>
  
  <p>The problem is that the last equality check hangs mocha: </p>
  
  <pre><code>  Campaign repository
      ✓ should create a new campaign
      1) should get the new campaign from the database
  
  
    1 passing (141ms)
    1 failing
  </code></pre>
  
  <p>And when doing the same tests on a non object, </p>
  
  <pre><code>return (campaignRepo.getCampaignById(scopeNewCampaign._id)).should.eventually.equal('just a string');
  </code></pre>
  
  <p>mocha just fails normally.</p>
  
  <pre><code>  Campaign repository
      ✓ should create a new campaign
      1) should get the new campaign from the database
  
  
    1 passing (141ms)
    1 failing
  
    1) Campaign repository should get the new campaign from the database:
       AssertionError: expected { Object ($__, isNew, ...) } to equal 'just a string'
  </code></pre>