Skip to content

Commit fdbd8bb

Browse files
authored
test(e2e): normalize template EOF markers across Rspack versions (#274)
1 parent 251a00a commit fdbd8bb

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

‎tests/e2e/__snapshots__/overlay.test.js.snap‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ exports[`overlay > should not show initially, then show on an error and allow to
113113
"
114114
>
115115
× Module parse failed: ╰─▶ × JavaScript parse error: Unterminated
116-
template literal ╭──── 1 │ \`; · ── ╰──── help: You may need an
117-
appropriate loader to handle this file type.
116+
template literal ╭──── 1 │ \`; ╰──── help: You may need an appropriate
117+
loader to handle this file type.
118118
</div>
119119
</div>
120120
</div>
@@ -243,8 +243,8 @@ exports[`overlay > should not show initially, then show on an error, then hide o
243243
"
244244
>
245245
× Module parse failed: ╰─▶ × JavaScript parse error: Unterminated
246-
template literal ╭──── 1 │ \`; · ── ╰──── help: You may need an
247-
appropriate loader to handle this file type.
246+
template literal ╭──── 1 │ \`; ╰──── help: You may need an appropriate
247+
loader to handle this file type.
248248
</div>
249249
</div>
250250
</div>
@@ -373,8 +373,8 @@ exports[`overlay > should not show initially, then show on an error, then show o
373373
"
374374
>
375375
× Module parse failed: ╰─▶ × JavaScript parse error: Unterminated
376-
template literal ╭──── 1 │ \`; · ── ╰──── help: You may need an
377-
appropriate loader to handle this file type.
376+
template literal ╭──── 1 │ \`; ╰──── help: You may need an appropriate
377+
loader to handle this file type.
378378
</div>
379379
</div>
380380
</div>
@@ -464,8 +464,8 @@ exports[`overlay > should not show initially, then show on an error, then show o
464464
"
465465
>
466466
× Module parse failed: ╰─▶ × JavaScript parse error: Unterminated
467-
template literal ╭──── 1 │ \`;a · ─── ╰──── help: You may need an
468-
appropriate loader to handle this file type.
467+
template literal ╭──── 1 │ \`;a ╰──── help: You may need an appropriate
468+
loader to handle this file type.
469469
</div>
470470
</div>
471471
</div>

‎tests/e2e/overlay.test.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ const formatOverlayHtml = (html) =>
118118
formatHtml(
119119
html,
120120
// ANSI-rendered spans differ across platforms, but the text content is stable.
121-
(value) => value.replace(/<\/?span[^>]*>/g, ''),
121+
(value) =>
122+
value
123+
.replace(/<\/?span[^>]*>/g, '')
124+
// swc-next 0.6.1 uses zero-length EOF ranges for these fixtures.
125+
// Normalize the older marker while retaining the diagnostic and source.
126+
.replace(/(1 │ `;a?)\s*· ─+(?=\s*╰────)/g, '$1'),
122127
);
123128

124129
const waitForOverlay = async (page) => {

0 commit comments

Comments
 (0)