From 748b2a2dd4e1c7ee2a3f00515af4e794cae3fb6c Mon Sep 17 00:00:00 2001 From: Dustin Popp Date: Mon, 30 Oct 2023 14:42:29 -0500 Subject: [PATCH] fix(deps): resolve vulnerability in axios version This commit forces a release for the updated axios version that resolved a vulnerability. It also includes build changes to stop testing on Node 14, which had EOL 6 months ago, start testing on Node 20, and document that Node 14 is technically no longer guaranteed, even though it is supported. This also fixes a test to be more flexible on different Node versions, as `JSON.parse()` throws slightly different errors on Node 18 vs Node 20. Signed-off-by: Dustin Popp --- .travis.yml | 2 +- README.md | 1 + test/unit/request-wrapper.test.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 63fb87c06..b6fd129af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,9 @@ language: node_js dist: jammy node_js: -- 14 - 16 - 18 +- 20 cache: npm: false diff --git a/README.md b/README.md index 9076d4660..bdc9113c5 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ This project contains core functionality required by Node.js code generated by t ## Prerequisites - Node.js version 14 or newer +- Note that v14 is technically *supported* but not officially *guaranteed* as we only test on v16 and higher ## Usage This package exports a single object containing a number of modules as top level properties. diff --git a/test/unit/request-wrapper.test.js b/test/unit/request-wrapper.test.js index e074786f3..29b41b0bc 100644 --- a/test/unit/request-wrapper.test.js +++ b/test/unit/request-wrapper.test.js @@ -707,7 +707,7 @@ describe('sendRequest', () => { mockAxiosInstance.mockResolvedValue(axiosResolveValue); await expect(requestWrapperInstance.sendRequest(parameters)).rejects.toThrow( - 'Error processing HTTP response: SyntaxError: Unexpected end of JSON input' + 'Error processing HTTP response: SyntaxError' ); expect(verboseLogSpy).toHaveBeenCalledTimes(2); expect(verboseLogSpy.mock.calls[0][0]).toBe( @@ -969,7 +969,7 @@ describe('formatError', () => { expect(() => { requestWrapperInstance.formatError(newAxiosError); - }).toThrow('Error processing HTTP response: SyntaxError: Unexpected end of JSON input'); + }).toThrow('Error processing HTTP response: SyntaxError'); expect(verboseLogSpy).toHaveBeenCalledTimes(2); expect(verboseLogSpy.mock.calls[0][0]).toBe( 'Response body was supposed to have JSON content but JSON parsing failed.'