UNPKG

docparse-dumpinvoices

Version:

takes a list of couchdb invoice ids and exports the data contained within those invoices to an Excel spreadsheet

31 lines (28 loc) 894 B
var assert = require('assert') var isLatePaymentChargeCost = require('../lib/isLatePaymentChargeCost') describe('Is Late Payment Charge', function () { it('should return true for late payment charge', function () { var cost = { description: 'late pmt chg', value: '1.99' } var isMatch = isLatePaymentChargeCost(cost) assert.ok(isMatch, 'should match') }) it('should return false for late payment charge credit', function () { var cost = { description: 'late pmt chg credit', value: '1.99' } var isMatch = isLatePaymentChargeCost(cost) assert.ok(!isMatch, 'should not be late payment charge') }) it('should return false for other cost', function () { var cost = { description: 'adjustment', value: '1.99' } var isMatch = isLatePaymentChargeCost(cost) assert.ok(!isMatch, 'should not match') }) })