mongoose-db-populator
This module helps to populate the MongoDB with documents for testing purposes. It also cleans the database (absolutely all collections).
;
Please, refer to test/integration/test.js
for details!
model factory
It's goal is to create a valid mongoose document using your options or some defaults
// ./support/model/Book.js//// ./support/model exports { Book : require('./Book')}// e.g. using require-directory module// // here your models are defined// db.Book === mongoose.model('Book')var db = ; var i = 1; module { options = options || {}; var bookDoc = title: optionstitle || 'Book title #' + i authors: optionsauthors || ; i++; return bookDoc;};
suite factory
It's purpose to create all the required documents. Internally model factories are used
// ./support/suite/main//// ./support/suite exports { main : require('./main')}// e.g. using require-directory module//module { // this refers to the instance of Suite var suite = this; var authors1 = 0123; var authors2 = 012; var book1 = suite; var book2 = suite; var book3 = suite;};