docparse-supplier-nge
Version:
process ngrid electric utility bill data for use in the docparse system
32 lines (31 loc) • 851 B
JavaScript
var should = require('should');
var inspect = require('eyespect').inspector();
var getData = require('../lib/parse/getData');
describe('get data', function () {
this.slow('1s');
it('get data should be wired up correctly', function (done) {
var toPay = '0';
var getUtilityData = function (data, cb) {
cb(null, {});
};
var parseSupply = function (data, cb) {
cb(null, {});
};
var calculateToPay = function (data, cb) {
cb(null, toPay);
};
var data = {
getUtilityData: getUtilityData,
parseSupply: parseSupply,
calculateToPay: calculateToPay,
text: 'foo bar'
};
getData(data, function (err, reply) {
should.not.exist(err);
should.exist(reply);
reply.should.have.property('toPay');
toPay.should.eql(reply.toPay);
done();
});
});
});