mocha-mongoose icon indicating copy to clipboard operation
mocha-mongoose copied to clipboard

New Mocha 3.0.0 breaks mocha-mongoose

Open johnrackles opened this issue 8 years ago • 2 comments

I'm using mocha-mongoose@^1.2.0 in my tests and with the new mocha version 3.0.0 an error is thrown.

Error: Resolution method is overspecified. Specify a callback or return a Promise; not both.

This Error is described here https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#boom-breaking-changes

johnrackles avatar Aug 04 '16 08:08 johnrackles

Thank you! If you have a suggestion of how to fix it, that'd great.

elliotf avatar Aug 05 '16 14:08 elliotf

You need to select the actual db. maybe you can extract the name from the URL, and if not given use a default like 'test'.

    client.connect(uriString, function(err, database){
      if (err) return done(err);

      db = database.db('test');      
      clearCollections(done);
    });

whoisstan avatar Jun 05 '18 15:06 whoisstan