Skip to content

Commit 9f010db

Browse files
committed
fix the test when there is only one batch
1 parent 7f51d7c commit 9f010db

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ describe('AuthorizeNet service', function () {
106106
.then(function (trans) {
107107
assert.equal(trans.transactionResponse.responseCode, '1');
108108
done();
109+
})
110+
.catch(function (err) {
111+
console.log(err);
109112
});
110113
});
111114

@@ -262,7 +265,8 @@ describe('AuthorizeNet service', function () {
262265
it('should get the batch statistics', function (done) {
263266
service.getSettledBatchList(true, new Date(Date.now() - 7 * 24 * 3600 * 1000), new Date()).then(function (response) {
264267
assert(response.batchList, 'batchList should be defined');
265-
return service.getBatchStatistics(response.batchList.batch[0].batchId);
268+
var batchId = response.batchList.batch.length ? response.batchList.batch[0].batchId : response.batchList.batch.batchId;
269+
return service.getBatchStatistics(batchId);
266270
})
267271
.then(function (response) {
268272
assert(response.batch, 'batch should be defined');

0 commit comments

Comments
 (0)