From 796679175f4dbd6c2a6c54be9351ce6d5d424aa0 Mon Sep 17 00:00:00 2001 From: sooniter Date: Tue, 10 Nov 2026 19:47:37 +0800 Subject: [PATCH] test(e2e): normalize template EOF markers across Rspack versions --- tests/e2e/__snapshots__/overlay.test.js.snap | 16 ++++++++-------- tests/e2e/overlay.test.js | 7 ++++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/e2e/__snapshots__/overlay.test.js.snap b/tests/e2e/__snapshots__/overlay.test.js.snap index a84e86f..b4c455f 100644 --- a/tests/e2e/__snapshots__/overlay.test.js.snap +++ b/tests/e2e/__snapshots__/overlay.test.js.snap @@ -113,8 +113,8 @@ exports[`overlay > should not show initially, then show on an error and allow to " > × Module parse failed: ╰─▶ × JavaScript parse error: Unterminated - template literal ╭──── 1 │ \`; · ── ╰──── help: You may need an - appropriate loader to handle this file type. + template literal ╭──── 1 │ \`; ╰──── help: You may need an appropriate + loader to handle this file type. @@ -243,8 +243,8 @@ exports[`overlay > should not show initially, then show on an error, then hide o " > × Module parse failed: ╰─▶ × JavaScript parse error: Unterminated - template literal ╭──── 1 │ \`; · ── ╰──── help: You may need an - appropriate loader to handle this file type. + template literal ╭──── 1 │ \`; ╰──── help: You may need an appropriate + loader to handle this file type. @@ -373,8 +373,8 @@ exports[`overlay > should not show initially, then show on an error, then show o " > × Module parse failed: ╰─▶ × JavaScript parse error: Unterminated - template literal ╭──── 1 │ \`; · ── ╰──── help: You may need an - appropriate loader to handle this file type. + template literal ╭──── 1 │ \`; ╰──── help: You may need an appropriate + loader to handle this file type. @@ -464,8 +464,8 @@ exports[`overlay > should not show initially, then show on an error, then show o " > × Module parse failed: ╰─▶ × JavaScript parse error: Unterminated - template literal ╭──── 1 │ \`;a · ─── ╰──── help: You may need an - appropriate loader to handle this file type. + template literal ╭──── 1 │ \`;a ╰──── help: You may need an appropriate + loader to handle this file type. diff --git a/tests/e2e/overlay.test.js b/tests/e2e/overlay.test.js index 073e066..4c1201d 100644 --- a/tests/e2e/overlay.test.js +++ b/tests/e2e/overlay.test.js @@ -118,7 +118,12 @@ const formatOverlayHtml = (html) => formatHtml( html, // ANSI-rendered spans differ across platforms, but the text content is stable. - (value) => value.replace(/<\/?span[^>]*>/g, ''), + (value) => + value + .replace(/<\/?span[^>]*>/g, '') + // swc-next 0.6.1 uses zero-length EOF ranges for these fixtures. + // Normalize the older marker while retaining the diagnostic and source. + .replace(/(1 │ `;a?)\s*· ─+(?=\s*╰────)/g, '$1'), ); const waitForOverlay = async (page) => {