docparse-create-bill

create new bill documents in a test database for use in docparse tests

npm install docparse-create-bill
28 downloads in the last month

create new bill documents in a test database for use in docparse tests. The mongoose database is mocked out with an in-memory store

Build Status

Dependency Status Dependency tracking by David

Usage

Default object

var inspect = require('eyespect').inspector()
var create = require('docparse-create-bill')
create(function(err, bill) {
  if (err) {
    inspect(err, 'error creating bill')
    return;
  }
  inspect(bill.toObject(), 'created bill');
});

With custom data

var data = {
  accountNumber: 'bar account number',
  billNumber:    'bar bill number',
  customerID:     new ObjectId(),
  supplierID:     new ObjectId(),
  supplierCode:  'FGS',
  remove:         true
}
var create = require('docparse-create-bill')
create(data, function(err, bill) {
  if (err) {
    inspect(err, 'error creating bill')
    return;
  }
  inspect(bill.toObject(), 'created bill');
});

Installation

npm install --save-dev docparse-create-bill

npm loves you