Skip to content

Commit

Permalink
test: get base URL from config
Browse files Browse the repository at this point in the history
  • Loading branch information
mwskwong committed Feb 22, 2024
1 parent 0cc0b70 commit d652078
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ Cypress.Commands.add(
cy.request({ url: href, failOnStatusCode: false }).then(
({ status }) => {
// use a dummy URL as base URL because href can be a relative path
const url = new URL(href, 'https://example.com');
const url = new URL(href, Cypress.config('baseUrl') ?? '');

if (url.hostname === 'www.linkedin.com') {
// 999 isreturned when LinkedIn is visited by bots
// 999 is returned when LinkedIn is visited by bots
expect(status).to.satisfy(
(status: number) =>
(status >= 200 && status <= 399) || status === 999,
Expand Down

0 comments on commit d652078

Please sign in to comment.