0.0.2 • Published 11 years ago
mongoose-mill v0.0.2
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