UNPKG

docparse-supplier-nge

Version:

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

20 lines 790 B
var fs = require('fs'); var should = require('should'); var assert = require('assert'); var path = require('path'); var inspect = require('eyespect').inspector(); var getSupplyData = require('../lib/parse/getSupplyData'); describe('Get Supply Data', function() { it('should get supply data correctly', function(done) { var text = 'Supply Services\n SUPPLIER National Grid\n\n\n Basic Service Variable 0.07939 x 20400 kWh 1,619.56\n Total Supply Services $ 1,619.56'; getSupplyData(text, function (err, reply) { should.not.exist(err); should.exist(reply); reply.costSupply.should.eql('1619.56'); reply.toPaySupply.should.eql('1619.56'); assert.ok(!reply.isComp); reply.should.not.have.property('costOtherSupply'); done(); }); }); });