'should not delete system.indexes collection': function(test) { var db = this.connection.db; databaseCleaner.clean(db, function () { db.collection('system.indexes', function (skip, collection) { collection.count({}, function (err, count) { test.ok(count > 0); test.done(); }); }); }); }
'should delete all collections items': function(test) { var db = this.connection.db; databaseCleaner.clean(db, function () { db.collections( function (skip, collections) { var total_collections = collections.length; collections.forEach(function (collection) { if (collection.collectionName != 'system.indexes') { collection.count({}, function (err, count) { test.equal(count, 0); total_collections--; if (total_collections <= 0) { test.done(); } }); } else { total_collections--; } }); }); }); },