Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.
/ mongoose-erase Public archive

Erase collections, models and schemas for unit testing with mongoose

License

Notifications You must be signed in to change notification settings

paperhive/mongoose-erase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongoose-erase

Build Status Coverage Status Dependency Status

NPM

Erase collections, models and schemas for unit testing with mongoose

Usage

With mocha, a unit test code that wipes the database before each test could look like this:

var mongoose = require('mongoose');
var erase = require('mongoose-erase');

describe('yourFunction()', function() {

  beforeEach(erase.connectAndErase(mongoose, 'mongodb://localhost/test'));

  it('should do something', function() {});

});

About

Erase collections, models and schemas for unit testing with mongoose

Resources

License

Stars

Watchers

Forks

Packages

No packages published