docparse-create-customer

create customer objects for use in docparse tests

npm install docparse-create-customer
20 downloads in the last week
40 downloads in the last month

create new customer 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-customer')
create(function(err, customer) {
  if (err) {
    inspect(err, 'error creating customer')
    return;
  }
  inspect(customer.toObject(), 'created customer');
});

With custom data

var create = require('docparse-create-customer')
var login1 = {
  supplier_code: 'FGS',
  username: 'fgsUsername1',
  password: 'fgsPassword1'
};

var login2 = {
  supplier_code: 'FGS',
  username: 'fgsUsername2',
  password: 'fgsPassword2'
};

var logins = [login1, login2];
var data = {
  customerName: 'customerName1',
  logins : logins
};
create(data, function(err, customer) {
  if (err) {
    inspect(err, 'error creating customer')
    return;
  }
  inspect(customer.toObject(), 'created customer');
});

Installation

npm install --save-dev docparse-create-customer

npm loves you