Commit be81adcc21ea131b956c897a4be9faa4bc9aba1a

Authored by Adhidarma Hadiwinoto
1 parent 8e7aae966a
Exists in master

mocha test

Showing 3 changed files with 14 additions and 0 deletions Side-by-side Diff

... ... @@ -28,5 +28,8 @@
28 28 "winston": "^2.2.0",
29 29 "xml": "^1.0.1",
30 30 "xml2js": "^0.4.16"
  31 + },
  32 + "devDependencies": {
  33 + "should": "^8.3.1"
31 34 }
32 35 }
partner-trustlink.js
... ... @@ -164,3 +164,4 @@ function directResponseHandler(body, task) {
164 164  
165 165 exports.start = start;
166 166 exports.topupRequest = topupRequest;
  167 +exports.calculateSignature = calculateSignature;
... ... @@ -0,0 +1,10 @@
  1 +var should = require("should");
  2 +var partner = require("./partner-trustlink");
  3 +
  4 +describe('#partner-trustlink', function() {
  5 + describe('#calculateSignature', function() {
  6 + it('should return correct signature', function() {
  7 + partner.calculateSignature('191001', '0812345678', 'abcdef').should.equal('CQ4HBVFTVlJSXg==');
  8 + });
  9 + });
  10 +});