Skip to content

Commit

Permalink
chore: fix purge base urls
Browse files Browse the repository at this point in the history
  • Loading branch information
csfeijo committed Dec 14, 2023
1 parent 18a5cf2 commit 9faf22d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/services/real-time-purge/make-real-time-purge-service.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const makeRealTimePurgeBaseUrl = () => {
return `purge`
const version = 'v4'
return `${version}/edge/purge`
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ describe('RealTimePurgeServices', () => {
statusCode: 201
})
const { sut } = makeSut()

const version = 'v4'
await sut(fixtures.realTimePurgeMock)

expect(requestSpy).toHaveBeenCalledWith({
url: `purge/cachekey`,
url: `${version}/edge/purge/cachekey`,
method: 'POST',
body: {
items: ['www.example.com', 'www.test.com.br'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const makeSut = () => {
describe('RealTimePurgeServices', () => {
it('should return the API base url to real-time purge', () => {
const { sut } = makeSut()
const correctApiUrl = 'purge'
const version = 'v4'
const correctApiUrl = `${version}/edge/purge`

const baseUrl = sut()

Expand Down
5 changes: 0 additions & 5 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ const getConfig = () => {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/graphql\/cities/, '/graphql')
},
'/api/purge': {
target: `${URLStartPrefix}api.azion.com/v4/edge/purge`,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/purge/, ''),
},
'^/api/(account|user|token|switch-account|password|totp)|^/logout': {
target: `${URLStartPrefix}sso.azion.com`,
changeOrigin: true,
Expand Down
2 changes: 1 addition & 1 deletion vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default mergeConfig(
outputFile: {
'vitest-sonar-reporter': './coverage/sonar-report.xml'
},
testTimeout: 20000
testTimeout: 30000
}
})
)

0 comments on commit 9faf22d

Please sign in to comment.