From ed1b91a31b227a7ef351d8f84c537dc21a942d87 Mon Sep 17 00:00:00 2001 From: Huzaif Date: Fri, 29 Jul 2022 00:31:36 +0530 Subject: [PATCH 1/2] coverage check --- test/accounts.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/accounts.js b/test/accounts.js index 64f4ea1b..cb17c883 100644 --- a/test/accounts.js +++ b/test/accounts.js @@ -81,6 +81,13 @@ describe('Account', function () { }) }); + it('should throw error for update subAccount via interface', function () { + return client.subAccounts.update() + .catch(function(errorResponse) { + assert.equal(errorResponse, 'Error: Missing mandatory field: id') + }) + }); + it('list subAccounts', function () { return client.subAccounts.list() .then(function(accounts) { From 210d967d115d9ec01314d312519bfec02179d185 Mon Sep 17 00:00:00 2001 From: Huzaif Date: Fri, 29 Jul 2022 01:23:24 +0530 Subject: [PATCH 2/2] coverage update --- .github/workflows/unitTests.yml | 2 +- test/accounts.js | 7 +++++++ test/media.js | 18 +++++++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unitTests.yml b/.github/workflows/unitTests.yml index 3532ff1e..9161c51a 100644 --- a/.github/workflows/unitTests.yml +++ b/.github/workflows/unitTests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - node-version: [6.x, 7.x, 8.x, 9.x, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x] + node-version: [8.x, 9.x, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x] steps: - uses: actions/checkout@v2 diff --git a/test/accounts.js b/test/accounts.js index cb17c883..56b0aba9 100644 --- a/test/accounts.js +++ b/test/accounts.js @@ -101,4 +101,11 @@ describe('Account', function () { assert.equal(accounts, true) }) }); + + it('Should throw error for delete subAccounts via interface', function () { + return client.subAccounts.delete() + .catch(function(errorResponse) { + assert.equal(errorResponse, 'Error: Missing mandatory field: id') + }) + }); }); diff --git a/test/media.js b/test/media.js index 14676c54..80e3d0d4 100644 --- a/test/media.js +++ b/test/media.js @@ -11,16 +11,32 @@ let client = new Client('sampleid', 'sammpletoken', 'sampleproxy'); describe('MediaInterface', function () { - it('list media via interface', function () { + it('list media via interface', function () { return client.media.list() .then(function (res) { assert.notEqual(res.length, 0) }) }); + + it(' should throw error for list media via interface', function () { + return client.media.list('id') + .catch(function(errorResponse) { + assert.equal(errorResponse, 'ReferenceError: id is not defined') + }) + }); + it('should get media', function () { return client.media.get('0178eb8a-461a-4fd1-bc37-13eebfdc0676') .then(function (res) { assert.equal(res.mediaId, '0178eb8a-461a-4fd1-bc37-13eebfdc0676') }) }); + + it('should throw error for get media', function () { + return client.media.get() + .catch(function(errorResponse) { + assert.equal(errorResponse, 'Error: Missing mandatory field: media_id') + }) + }); + });