mongoose-mill

0.0.2 • Public • Published

mongoose-mill

Build Status Code Climate David DM

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

Package Sidebar

Install

npm i mongoose-mill

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • yunghwakwon