Skip to content

Commit

Permalink
chore: Update the axios dependencies (#252)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
scottlovegrove and renovate[bot] authored Jan 17, 2024
1 parent cbf55a0 commit a547908
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
v16
v18
@doist:registry=https://npm.pkg.github.com/
70 changes: 31 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"prepare": "npm run build"
},
"dependencies": {
"axios": "^0.27.0",
"axios-case-converter": "^0.11.0",
"axios": "^1.0.0",
"axios-case-converter": "^1.0.0",
"axios-retry": "^3.1.9",
"runtypes": "^6.5.0",
"ts-custom-error": "^3.2.0",
Expand All @@ -34,7 +34,6 @@
"devDependencies": {
"@doist/eslint-config": "8.1.3",
"@doist/prettier-config": "3.0.5",
"@types/axios": "0.14.0",
"@types/jest": "29.4.0",
"@types/uuid": "8.3.4",
"@typescript-eslint/eslint-plugin": "5.54.1",
Expand Down
4 changes: 3 additions & 1 deletion src/restClient.axios.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ describe('axios tests without mocking', () => {
params: {
ids: ['12345', '56789'],
},
paramsSerializer,
paramsSerializer: {
serialize: paramsSerializer,
},
})
expect(requestUri).toEqual('https://api.todoist.com/rest/v2/tasks?ids=12345%2C56789')
})
Expand Down
9 changes: 7 additions & 2 deletions src/restClient.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-named-as-default
import Axios, { AxiosStatic, AxiosResponse, AxiosError } from 'axios'
import { request, isSuccess, paramsSerializer } from './restClient'
import { TodoistRequestError } from './types/errors'
Expand Down Expand Up @@ -120,7 +121,9 @@ describe('restClient', () => {
expect(axiosMock.get).toBeCalledTimes(1)
expect(axiosMock.get).toBeCalledWith(DEFAULT_ENDPOINT, {
params: undefined,
paramsSerializer,
paramsSerializer: {
serialize: paramsSerializer,
},
})
})

Expand All @@ -136,7 +139,9 @@ describe('restClient', () => {
expect(axiosMock.get).toBeCalledTimes(1)
expect(axiosMock.get).toBeCalledWith(DEFAULT_ENDPOINT, {
params: DEFAULT_PAYLOAD,
paramsSerializer,
paramsSerializer: {
serialize: paramsSerializer,
},
})
})

Expand Down
5 changes: 4 additions & 1 deletion src/restClient.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-named-as-default
import Axios, { AxiosResponse, AxiosError } from 'axios'
import applyCaseMiddleware from 'axios-case-converter'
import { TodoistRequestError } from './types/errors'
Expand Down Expand Up @@ -105,7 +106,9 @@ export async function request<T>(
case 'GET':
return await axiosClient.get<T>(relativePath, {
params: payload,
paramsSerializer,
paramsSerializer: {
serialize: paramsSerializer,
},
})
case 'POST':
return await axiosClient.post<T>(relativePath, payload)
Expand Down

0 comments on commit a547908

Please sign in to comment.