UNPKG

docparse-supplier-nge

Version:

process ngrid electric utility bill data for use in the docparse system

31 lines (30 loc) 858 B
var should = require('should'); var inspect = require('eyespect').inspector(); var getUtilityData = require('../lib/parse/getUtilityData'); describe('get utility data', function () { this.slow('1s'); it('get utility data should be wired up correctly', function (done) { var costDelivery = '1.99'; var getCostOther = function (data, cb) { cb(null, {}); }; var getUse = function (data, cb) { cb(null, {}); }; var getCostDelivery = function (data, cb) { cb(null, costDelivery); }; var data = { getCostDelivery: getCostDelivery, getCostOther: getCostOther, getUse: getUse, text: 'foo bar' }; getUtilityData(data, function (err, reply) { should.not.exist(err); should.exist(reply); costDelivery.should.eql(reply.costDelivery); done(); }); }); });