diff --git a/tests/support/browser/strict-browser-test.ts b/tests/support/browser/strict-browser-test.ts index e84891d..edde745 100644 --- a/tests/support/browser/strict-browser-test.ts +++ b/tests/support/browser/strict-browser-test.ts @@ -5,10 +5,22 @@ import { type Page, } from "@playwright/test"; +/** + * Firefox's font sanitizer (OTS) reports that the `name` table of the bundled + * `pretendard` 1.3.9 variable font lists its records out of order. It sorts + * them itself and the font still loads (`document.fonts.check` is true in + * Firefox); Chromium and WebKit say nothing. The file is the npm package's, not + * ours. Only this exact warning for this font is ignored: a font the sanitizer + * rejects logs a different line and still fails. + */ +const FIREFOX_PRETENDARD_NAME_ORDER = + /^\[JavaScript Warning: "downloadable font: name: name records are not sorted\. \(font-family: "Pretendard Variable" style:normal weight:45\.\.920 stretch:100 src index:0\) source: http:\/\/127\.0\.0\.1:\d+\/[\w./@-]*PretendardVariable(?:-[\w-]+)?\.woff2"\]$/u; + function ignoredConsole(message: ConsoleMessage) { return ( message.type() === "warning" && - message.text().includes("NO_COLOR") + (message.text().includes("NO_COLOR") || + FIREFOX_PRETENDARD_NAME_ORDER.test(message.text())) ); }