Skip to content

Commit

Permalink
TG-1098 Remove axios dependency and boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca committed Jan 28, 2024
1 parent ae58ab7 commit 668deae
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import { pactWith } from 'jest-pact/dist/v3'
import { HTTPMethod } from '../utils'
import pactConfig from '../pact.config'

import { axios, withApiOptions } from '@/utils/api/axios'

const healthCheck = withApiOptions<{ status: string }>(({ baseUrl }) => {
return axios.get(`${baseUrl}/api/health/`)
})

pactWith(pactConfig, interaction => {
const interactionName = 'A health check request'
interaction(interactionName, ({ provider, execute }) => {
Expand All @@ -27,11 +21,9 @@ pactWith(pactConfig, interaction => {
})
})
execute(interactionName, async mockServer => {
const { data, status } = await healthCheck({
baseUrl: mockServer.url
})
const { body, status } = await fetch(`${mockServer.url}/api/health/`)
expect(status).toBe(204)
expect(data).toEqual('')
expect(body).toEqual('')
})
})
})
1 change: 0 additions & 1 deletion {{cookiecutter.project_dirname}}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@next/font": "^13.4.19",
"@reduxjs/toolkit": "^1.9.5",
"@sentry/nextjs": "^7.64.0",
"axios": "^1.4.0",
"basic-auth": "^2.0.1",
"express": "^4.18.2",
"next": "^13.4.19",
Expand Down
18 changes: 0 additions & 18 deletions {{cookiecutter.project_dirname}}/src/utils/api/auth.ts

This file was deleted.

95 changes: 0 additions & 95 deletions {{cookiecutter.project_dirname}}/src/utils/api/axios.ts

This file was deleted.

1 change: 0 additions & 1 deletion {{cookiecutter.project_dirname}}/src/utils/api/index.ts

This file was deleted.

11 changes: 1 addition & 10 deletions {{cookiecutter.project_dirname}}/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1892,15 +1892,6 @@ axios@^0.27.2:
follow-redirects "^1.14.9"
form-data "^4.0.0"

axios@^1.4.0:
version "1.6.5"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.5.tgz#2c090da14aeeab3770ad30c3a1461bc970fb0cd8"
integrity sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==
dependencies:
follow-redirects "^1.15.4"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

axobject-query@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-3.2.1.tgz#39c378a6e3b06ca679f29138151e45b2b32da62a"
Expand Down Expand Up @@ -3516,7 +3507,7 @@ flatted@^3.2.9:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf"
integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==

follow-redirects@^1.0.0, follow-redirects@^1.14.9, follow-redirects@^1.15.4:
follow-redirects@^1.0.0, follow-redirects@^1.14.9:
version "1.15.5"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.5.tgz#54d4d6d062c0fa7d9d17feb008461550e3ba8020"
integrity sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==
Expand Down

0 comments on commit 668deae

Please sign in to comment.