import { readFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import vm from 'node:vm'; import { describe, expect, it } from 'vitest'; const repoRoot = fileURLToPath(new URL('../../../', import.meta.url)); const framesDir = path.join(repoRoot, 'assets', 'frames'); const FRAME_FILES = [ 'iphone-15-pro.html', 'android-pixel.html', 'ipad-pro.html', 'macbook.html', 'browser-chrome.html', ] as const; function extractFrameScript(htmlPath: string): string { const html = readFileSync(htmlPath, 'utf8'); const matches = html.matchAll(/