test.js
847 Bytes
var should = require('should');
var neoxmlinutil = require('./neoxmlinutil');
describe('#neoxmlinutil', function() {
before(function(ready) {
neoxmlinutil.connectToOracle(ready);
})
it ('#should return correct transaction id', function() {
var message = 'SN=4786-4311-9060-7286-2722/RAJUDIN/R1/1300VA/13.7;31/05/16 12:10 ISI PLN20 KE 45008590213, BERHASIL.SAL=54.283.173,HRG=19.950,ID=2565605,SN=4786-4311-9060-7286-2722/RAJUDIN/R1/1300VA/13.7; -- Telkomsel Nasional kode S denom 5000 harga 5300 silahkan';
neoxmlinutil.getTransactionIdFromMessage(message).should.equal('2565605');
})
it ('#should return correct reverse url', function(done) {
neoxmlinutil.getReverseUrl('R97DEV', function(err, result) {
result.should.not.be.empty();
done();
})
})
})