mongoose-mill
Mongoose factories for tests
Install
npm install mongoose-mill
Usage
var mongoose = require('mongoose');
var factory = require('mongoose-mill')(mongoose);
var userf = factory('User', {provider: 'github'});
var user = userf({name: 'Foo', oauth_id: '12345'}),
user
.then(function(resource) {
// resource => {
// provider: 'github',
// name: 'Foo',
// oauth_id: '12345'
// }
});
Factory functions (eg. userf
) when invoked will return a Promise
.
License
MIT