Skip to content

Commit 4281f3f

Browse files
authored
Merge pull request #35 from erezrokah/update_dependencies
update dependencies to fix security issue
2 parents 777af92 + 5e39955 commit 4281f3f

File tree

6 files changed

+1265
-1302
lines changed

6 files changed

+1265
-1302
lines changed

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aws-testing-library",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Chai and Jest matchers for aws services",
55
"scripts": {
66
"lint": "tslint 'src/**/*.ts'",
@@ -43,27 +43,27 @@
4343
"license": "MIT",
4444
"devDependencies": {
4545
"@types/chai": "^4.1.7",
46-
"@types/jest": "^23.3.2",
47-
"@types/jest-diff": "^20.0.0",
48-
"@types/jest-matcher-utils": "^21.0.1",
46+
"@types/jest": "^24.0.13",
47+
"@types/jest-diff": "^20.0.1",
48+
"@types/jest-matcher-utils": "^21.0.2",
4949
"@types/mockdate": "^2.0.0",
50-
"@types/node": "^10.11.1",
50+
"@types/node": "^12.0.4",
5151
"@types/uuid": "^3.4.4",
5252
"chai": "^4.2.0",
53-
"jest": "^23.6.0",
54-
"jest-junit": "^5.1.0",
53+
"jest": "^24.8.0",
54+
"jest-junit": "^6.4.0",
5555
"mockdate": "^2.0.2",
56-
"prettier": "^1.14.3",
57-
"ts-jest": "^23.10.1",
58-
"ts-node": "^7.0.1",
59-
"tslint": "^5.11.0",
60-
"tslint-config-prettier": "^1.15.0",
61-
"typescript": "^3.0.3"
56+
"prettier": "^1.17.1",
57+
"ts-jest": "^24.0.2",
58+
"ts-node": "^8.2.0",
59+
"tslint": "^5.17.0",
60+
"tslint-config-prettier": "^1.18.0",
61+
"typescript": "^3.5.1"
6262
},
6363
"dependencies": {
64-
"aws-sdk": "^2.323.0",
65-
"axios": "^0.18.1",
66-
"jest-diff": "^23.6.0",
64+
"aws-sdk": "^2.469.0",
65+
"axios": "^0.19.0",
66+
"jest-diff": "^24.8.0",
6767
"uuid": "^3.3.2"
6868
},
6969
"engines": {

src/chai/api.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Method } from 'axios';
12
import chai = require('chai');
23
import './';
34
import api from './api';
@@ -13,7 +14,7 @@ chai.use(api);
1314
describe('api', () => {
1415
describe('response', () => {
1516
const url = 'url';
16-
const method = 'POST';
17+
const method = 'POST' as Method;
1718
const params = { param1: 'param1' };
1819
const data = { data1: 'data1' };
1920
const headers = { header1: 'header1' };

src/common/api.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { Method } from 'axios';
12
import { IPlainObject } from '../utils/api';
23

34
export interface IApiProps {
4-
method: string;
5+
method: Method;
56
url: string;
67
params?: IPlainObject;
78
data?: IPlainObject;

src/jest/api.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Method } from 'axios';
12
import * as originalUtils from 'jest-matcher-utils';
23
import { EOL } from 'os';
34
import { toReturnResponse } from './api';
@@ -23,7 +24,7 @@ describe('api matchers', () => {
2324
},
2425
};
2526
const url = 'url';
26-
const method = 'POST';
27+
const method = 'POST' as Method;
2728
const params = { param1: 'param1' };
2829
const data = { data1: 'data1' };
2930
const headers = { header1: 'header1' };

src/utils/api.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
import axios from 'axios';
1+
import axios, { AxiosRequestConfig, Method } from 'axios';
22

33
export interface IPlainObject extends Record<string, string> {}
44

55
export const getResponse = async (
66
url: string,
7-
method: string,
7+
method: Method,
88
params?: IPlainObject,
99
data?: IPlainObject,
1010
headers?: IPlainObject,
1111
) => {
12-
const result = await axios({
12+
const config: AxiosRequestConfig = {
1313
data,
1414
headers,
1515
method,
1616
params,
1717
timeout: 30 * 1000,
1818
url,
1919
validateStatus: () => true, // accept any status code
20-
});
20+
};
21+
22+
const result = await axios(config);
2123
return { statusCode: result.status, data: result.data };
2224
};

0 commit comments

Comments
 (0)