import { readFile } from 'node:fs/promises'; import { test } from 'node:test'; import assert from 'node:assert/strict'; /** * Structural checks for the comparison pages: canonical URLs, the * WebPage + FAQPage + BreadcrumbList structured data, a short verdict before * the detail, at least one comparison table, cross-links and sitemap entries. */ const distRoot = new URL('../../dist/apps/website/', import.meta.url); const SITE = 'https://4gray.github.io/iptvnator'; const COMPARISONS = ['m3u-vs-xtream-vs-stalker', 'playback-engines', 'desktop-vs-browser']; const readDist = (relativePath) => readFile(new URL(relativePath, distRoot), 'utf8'); function extractJsonLd(html) { const blocks = [...html.matchAll(/