@@ -57,13 +57,7 @@ Then('WP Rocket settings links are not broken', async function (this: ICustomWor
5757 }
5858
5959 // Normalize and filter URLs
60- let normalizedUrls = normalizeUrls ( allHrefs , basePageUrl ) ;
61-
62- // Exclude URLs that may trigger transactional side effects
63- const skipPatterns = [ / \/ r e n e w \/ / i, / \/ u p g r a d e \/ / i] ;
64- normalizedUrls = new Set (
65- Array . from ( normalizedUrls ) . filter ( url => ! skipPatterns . some ( pattern => pattern . test ( url ) ) )
66- ) ;
60+ const normalizedUrls = normalizeUrls ( allHrefs , basePageUrl ) ;
6761
6862 // Warn if no valid URLs found to validate
6963 if ( normalizedUrls . size === 0 ) {
@@ -72,8 +66,9 @@ Then('WP Rocket settings links are not broken', async function (this: ICustomWor
7266 return ;
7367 }
7468
75- // Validate all collected URLs
76- const brokenLinks = await validateLinks ( this . page , normalizedUrls , currentHost ) ;
69+ // Validate all collected URLs, excluding URLs that may trigger transactional side effects
70+ const skipPatterns = [ / \/ r e n e w \/ / i, / \/ u p g r a d e \/ / i, / \/ e x p r e s s - c h e c k o u t / i] ;
71+ const brokenLinks = await validateLinks ( this . page , normalizedUrls , currentHost , skipPatterns ) ;
7772
7873 // Report all broken links at once
7974 expect ( brokenLinks , 'Broken links detected' ) . toHaveLength ( 0 ) ;
0 commit comments