import { access, readFile } from 'node:fs/promises'; import { test } from 'node:test'; import assert from 'node:assert/strict'; /** * Structural checks for guide posts: they must carry FAQPage structured data * next to the BlogPosting entry, link to the download hub, and reference only * screenshots that the build actually shipped. */ const distRoot = new URL('../../dist/apps/website/', import.meta.url); const SITE = 'https://4gray.github.io/iptvnator'; const GUIDES = [ { slug: 'xtream-codes-setup-guide', screenshots: [ 'blog/guides/screenshots/guide-xtream-add-playlist-dark.png', 'blog/guides/screenshots/guide-xtream-auto-detect-dark.png', 'blog/guides/screenshots/guide-xtream-live-dark.png', ], }, ]; const readDist = (relativePath) => readFile(new URL(relativePath, distRoot), 'utf8'); function extractJsonLd(html) { const blocks = [...html.matchAll(/