From a05098d158cad479950f6d73634471758d0e90c7 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Thu, 30 Apr 2026 07:57:35 +0000 Subject: [PATCH] test: allow underscores in hash for server routes preload links Updates the regular expressions in server-routes-preload-links.ts to allow underscores in the generated file hashes (changing [a-zA-Z0-9]{8} to [a-zA-Z0-9_]{8}). This ensures that the test correctly identifies modulepreload links when the hash contains an underscore, preventing failures due to overly strict matching. --- .../server-routes-preload-links.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/e2e/tests/build/server-rendering/server-routes-preload-links.ts b/tests/e2e/tests/build/server-rendering/server-routes-preload-links.ts index 5b2f1257d41f..4094ee4351b9 100644 --- a/tests/e2e/tests/build/server-rendering/server-routes-preload-links.ts +++ b/tests/e2e/tests/build/server-rendering/server-routes-preload-links.ts @@ -132,7 +132,7 @@ export default async function () { const res = await fetch(`http://localhost:${defaultServerPort}/`); const text = await res.text(); - const homeMatch = //; + const homeMatch = //; assert.match(text, homeMatch, `Response for '/': ${homeMatch} was not matched in content.`); const link = text.match(homeMatch)?.[1]; @@ -148,36 +148,36 @@ const RESPONSE_EXPECTS: Record< } > = { '/': { - matches: [//], + matches: [//], notMatches: [/ssg\-component/, /ssr/, /csr/, /cross-dep-/], }, '/ssg': { matches: [ - //, - //, + //, + //, ], notMatches: [/home/, /ssr/, /csr/, /ssg-one/, /ssg-two/, /cross-dep-/], }, '/ssg/one': { matches: [ - //, - //, + //, + //, ], notMatches: [/home/, /ssr/, /csr/, /ssg-two/, /ssg\-component/, /cross-dep-/], }, '/ssg/two': { matches: [ - //, - //, + //, + //, ], notMatches: [/home/, /ssr/, /csr/, /ssg-one/, /ssg\-component/, /cross-dep-/], }, '/ssr': { - matches: [//], + matches: [//], notMatches: [/home/, /ssg\-component/, /csr/], }, '/csr': { - matches: [//], + matches: [//], notMatches: [/home/, /ssg\-component/, /ssr/, /cross-dep-/], }, };