Skip to content

Commit

Permalink
Merge pull request #42 from filiphric/40-null-before-api-url-on-verb-…
Browse files Browse the repository at this point in the history
…section

fix: remove null from url if baseUrl is not defined
  • Loading branch information
filiphric authored Nov 5, 2022
2 parents 5427828 + 3294376 commit 2b2ba80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Cypress.Commands.add('api', (...args: any[]): Cypress.Chainable<any> => {
props.push(propItem)

props[index].method = structuredClone(options.method) || 'GET'
props[index].url = Cypress.config('baseUrl') + structuredClone(options.url).replace(Cypress.config('baseUrl') as string, '') || Cypress.config('baseUrl') + '/'
props[index].url = (Cypress.config('baseUrl') + structuredClone(options.url).replace(Cypress.config('baseUrl') as string, '')).replace('null', '') || Cypress.config('baseUrl') + '/'
props[index].query.body = structuredClone(options.qs)
props[index].auth.body = structuredClone(options.auth)
props[index].requestHeaders.body = structuredClone(options.headers)
Expand Down

0 comments on commit 2b2ba80

Please sign in to comment.