From bee508c98f59836900591e91a74a6203edf8db04 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Mon, 20 Sep 2021 10:30:30 -0400 Subject: [PATCH 1/5] add temp logging --- tests/api.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/api.test.js b/tests/api.test.js index 5b5f00c..146d526 100644 --- a/tests/api.test.js +++ b/tests/api.test.js @@ -67,6 +67,9 @@ describe('api', () => { machineDetection: machineDetection }; + console.log(body); + console.log(machineDetection); + const createCallResponse = await controller.createCall(accountId, body); expect(createCallResponse.result.applicationId).toEqual(applicationId); expect(createCallResponse.result.to).toEqual(to); From 83473f401fad9753125dac2b914625ef8a41680f Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Mon, 20 Sep 2021 10:40:51 -0400 Subject: [PATCH 2/5] moar logs --- tests/api.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/api.test.js b/tests/api.test.js index 146d526..35312a0 100644 --- a/tests/api.test.js +++ b/tests/api.test.js @@ -75,6 +75,8 @@ describe('api', () => { expect(createCallResponse.result.to).toEqual(to); expect(createCallResponse.result.from).toEqual(from); + console.log(createCallResponse); + // get call state const callId = createCallResponse.result.callId; const getCallStateResponse = await controller.getCall(accountId, callId); From f065eaff39a13661d878857744e8e25e7ad27939 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Mon, 20 Sep 2021 10:43:34 -0400 Subject: [PATCH 3/5] Update api.test.js --- tests/api.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/api.test.js b/tests/api.test.js index 35312a0..5a99918 100644 --- a/tests/api.test.js +++ b/tests/api.test.js @@ -71,11 +71,12 @@ describe('api', () => { console.log(machineDetection); const createCallResponse = await controller.createCall(accountId, body); + console.log(createCallResponse); expect(createCallResponse.result.applicationId).toEqual(applicationId); expect(createCallResponse.result.to).toEqual(to); expect(createCallResponse.result.from).toEqual(from); - console.log(createCallResponse); + // get call state const callId = createCallResponse.result.callId; From 90b0891f377d30cbe8d2f8f87fe4c5d5e379c7a1 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Mon, 20 Sep 2021 10:47:41 -0400 Subject: [PATCH 4/5] add try/catch --- tests/api.test.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/api.test.js b/tests/api.test.js index 5a99918..79f061b 100644 --- a/tests/api.test.js +++ b/tests/api.test.js @@ -70,7 +70,13 @@ describe('api', () => { console.log(body); console.log(machineDetection); - const createCallResponse = await controller.createCall(accountId, body); + try { + const createCallResponse = await controller.createCall(accountId, body); + } catch (e) { + console.log(e); + } + + console.log(createCallResponse); expect(createCallResponse.result.applicationId).toEqual(applicationId); expect(createCallResponse.result.to).toEqual(to); From d8c02ff4d1dd6dcfdbedad99e8b01df2b9a9ade4 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Mon, 20 Sep 2021 11:29:54 -0400 Subject: [PATCH 5/5] Update package file and remove logging --- package-lock.json | 18 +++++++++--------- package.json | 3 +-- tests/api.test.js | 14 +------------- 3 files changed, 11 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 472e339..bda29e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "@bandwidth/voice", - "version": "2.0.1", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@bandwidth/voice", - "version": "2.0.1", + "version": "1.0.0", "license": "MIT", "dependencies": { "@apimatic/core": "^0.6.1", "@apimatic/schema": "^0.6.0", "@types/node": "^14.14.27", - "axios": "^0.21.0", + "axios": "^0.21.4", "detect-node": "^2.0.4", "form-data": "^3.0.0", "lodash.flatmap": "^4.5.0", @@ -2573,9 +2573,9 @@ } }, "node_modules/axios": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.2.tgz", - "integrity": "sha512-87otirqUw3e8CzHTMO+/9kh/FSgXt/eVDvipijwDtEuwbkySWZ9SBm6VEubmJ/kLKEoLQV/POhxXFb66bfekfg==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "dependencies": { "follow-redirects": "^1.14.0" } @@ -13991,9 +13991,9 @@ "dev": true }, "axios": { - "version": "0.21.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.2.tgz", - "integrity": "sha512-87otirqUw3e8CzHTMO+/9kh/FSgXt/eVDvipijwDtEuwbkySWZ9SBm6VEubmJ/kLKEoLQV/POhxXFb66bfekfg==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "requires": { "follow-redirects": "^1.14.0" } diff --git a/package.json b/package.json index 6255a8c..830252e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "lint": "tsdx lint src", "prepare": "tsdx build" }, - "peerDependencies": {}, "prettier": { "printWidth": 80, "semi": true, @@ -42,7 +41,7 @@ "@apimatic/core": "^0.6.1", "@apimatic/schema": "^0.6.0", "@types/node": "^14.14.27", - "axios": "^0.21.0", + "axios": "^0.21.4", "detect-node": "^2.0.4", "form-data": "^3.0.0", "lodash.flatmap": "^4.5.0", diff --git a/tests/api.test.js b/tests/api.test.js index 79f061b..5b5f00c 100644 --- a/tests/api.test.js +++ b/tests/api.test.js @@ -67,23 +67,11 @@ describe('api', () => { machineDetection: machineDetection }; - console.log(body); - console.log(machineDetection); - - try { - const createCallResponse = await controller.createCall(accountId, body); - } catch (e) { - console.log(e); - } - - - console.log(createCallResponse); + const createCallResponse = await controller.createCall(accountId, body); expect(createCallResponse.result.applicationId).toEqual(applicationId); expect(createCallResponse.result.to).toEqual(to); expect(createCallResponse.result.from).toEqual(from); - - // get call state const callId = createCallResponse.result.callId; const getCallStateResponse = await controller.getCall(accountId, callId);