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', 'iptvnator-vs-vlc', 'iptvnator-vs-kodi', 'computer-vs-tv-box', ]; /** Pages that name other software must say they are not affiliated with it, and date their claims. */ const NAMES_THIRD_PARTY_SOFTWARE = new Set([ 'iptvnator-vs-vlc', 'iptvnator-vs-kodi', 'computer-vs-tv-box', ]); const readDist = (relativePath) => readFile(new URL(relativePath, distRoot), 'utf8'); function extractJsonLd(html) { const blocks = [...html.matchAll(/