Skip to content

Commit

Permalink
Merge pull request #108 from Typeform/fix/TU-2535/update-axios
Browse files Browse the repository at this point in the history
fix(TU-2535): secure dependencies, update axios
  • Loading branch information
Thr44 authored Nov 15, 2023
2 parents 255c51e + 483ac04 commit 1fed3be
Show file tree
Hide file tree
Showing 4 changed files with 1,076 additions and 1,314 deletions.
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@
"yarn.lock"
],
"dependencies": {
"axios": "^0.27.2"
"axios": "^1.6.0"
},
"devDependencies": {
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^8.1.0",
"@semantic-release/exec": "^5.0.0",
"@typeform/eslint-config": "^6.0.3",
"@types/jest": "^24.0.18",
"axios-mock-adapter": "^1.17.0",
"axios-mock-adapter": "^1.22.0",
"eslint": "^8.43.0",
"husky": "^4.0.0-beta.1",
"in-publish": "^2.0.0",
"jest": "^24.9.0",
"jest": "^28.1.0",
"json-server": "^0.15.1",
"lint-staged": "^13.2.2",
"nodemon": "^1.19.2",
Expand All @@ -83,13 +83,15 @@
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-typescript2": "^0.24.1",
"semantic-release": "^17.0.7",
"ts-jest": "^24.0.2",
"ts-jest": "^28.0.8",
"tslib": "^2.6.2",
"typescript": "^4.9.5"
},
"jest": {
"automock": false,
"testURL": "http://localhost/",
"testEnvironmentOptions": {
"url": "http://localhost/"
},
"preset": "ts-jest"
},
"prettier": "@typeform/eslint-config/prettier",
Expand Down
5 changes: 4 additions & 1 deletion tests/common.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export const axios = new (require('axios-mock-adapter'))(require('axios'))
import axiosLib from 'axios'
import MockAdapter from 'axios-mock-adapter'

export const axios = new MockAdapter(axiosLib)
2 changes: 1 addition & 1 deletion tests/unit/create-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('request pass correct headers', async () => {
},
})
expect(axios.history.get[0].url).toBe(`${API_BASE_URL}/forms`)
expect(axios.history.get[0].headers).toEqual({
expect({ ...axios.history.get[0].headers }).toEqual({
Accept: 'application/json, text/plain, */*',
Accepts: 'application/json',
Authorization: 'bearer abc',
Expand Down
Loading

0 comments on commit 1fed3be

Please sign in to comment.