Skip to content

Commit

Permalink
fix(deps): resolve vulnerability in axios version (#256)
Browse files Browse the repository at this point in the history
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 <dpopp07@gmail.com>
  • Loading branch information
dpopp07 committed Oct 31, 2023
1 parent b97b640 commit 9bc0358
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ language: node_js
dist: jammy

node_js:
- 14
- 16
- 18
- 20

cache:
npm: false
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions test/unit/request-wrapper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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.'
Expand Down

0 comments on commit 9bc0358

Please sign in to comment.