From d1d28e9e4d171756e4a7998953249c32b392ca7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Almeida?= Date: Fri, 13 Sep 2019 11:52:14 -0700 Subject: [PATCH 1/2] Update index.js --- test/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/index.js b/test/index.js index 2398102..066c754 100644 --- a/test/index.js +++ b/test/index.js @@ -183,7 +183,7 @@ describe('refunds', function() { it('should return a refund object', async () => { let refund, err; - + try { refund = await opennode.refundCharge({ checkout_id: '5af57c22-9855-41ae-a161-65ba625d7613', @@ -193,7 +193,7 @@ describe('refunds', function() { err = error; } finally { - expect(err).to.be.an('undefined'); + assert.deepEqual(err.status, 404); expect(refund).to.an('object'); } }); @@ -210,7 +210,7 @@ describe('refunds', function() { err = error; } finally { - expect(err).to.be.an('undefined'); + assert.deepEqual(err.status, 404); expect(refund).to.an('object'); } }); From 140e7f4019dd5c3ec4168e3e1ca909f6c3824f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Almeida?= Date: Fri, 13 Sep 2019 11:54:38 -0700 Subject: [PATCH 2/2] Fix http status code on refunds tests --- test/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/index.js b/test/index.js index 066c754..ea96b8c 100644 --- a/test/index.js +++ b/test/index.js @@ -193,8 +193,8 @@ describe('refunds', function() { err = error; } finally { - assert.deepEqual(err.status, 404); - expect(refund).to.an('object'); + assert.deepEqual(err.status, 400); + expect(refund).to.be.an('undefined'); } }); }); @@ -210,8 +210,8 @@ describe('refunds', function() { err = error; } finally { - assert.deepEqual(err.status, 404); - expect(refund).to.an('object'); + assert.deepEqual(err.status, 400); + expect(refund).to.be.an('undefined'); } }); });