Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO-ISSUE] chore: fix purge base URL's #478

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
})
)