font-match: a browser module without its binary is the same as no browser

CI resolves playwright but has no downloaded chromium; launch threw instead of falling back to the catalog ranking, and every spec gate downstream failed. Launch failures now return the no-browser path (and the browser test skips instead of asserting).

AI-assisted (Claude Code).
This commit is contained in:
Paul Bakaus
2026-08-28 14:47:21 -07:00
parent c75f9f1086
commit 7edc5a43da
2 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ describe('font-match', () => {
it('renders and ranks candidates against a League Gothic sample (browser)', { skip: !hasPlaywright && 'playwright not resolvable' }, async () => {
const results = await renderCandidates([{ family: 'League Gothic', weight: 400 }, { family: 'Inter', weight: 400 }], 'The manuals stop.', 48);
assert.ok(results, 'no browser');
if (!results) return; // module resolves but no browser binary (CI): the catalog fallback owns it
const ok = results.filter((r) => r.loaded && r.fp);
if (ok.length < 2) return; // offline: Google Fonts unreachable
const index = loadFontIndex();