import { createServer } from 'node:http'; import { brotliCompressSync, gzipSync } from 'node:zlib'; import { afterEach, describe, expect, it } from 'vitest'; // @ts-expect-error The production smoke checker is an executable ESM module. import { verifyProductionSmoke } from '../../scripts/smoke-production.mjs'; const digest = 'a'.repeat(64); const canonical = 'https://portfolio.example/'; const alternate = 'http://www.portfolio.example/'; const escapedTitle = 'Luca Pîslaru — System Administrator & Full-Stack Developer'; const description = 'Portfolio of Luca Pîslaru, a Bucharest-based System Administrator and Full-Stack Developer working across Linux infrastructure and end-to-end software delivery.'; const socialImage = `${canonical}assets/project-social-preview.webp`; const projectStillMaxBytes = 400 * 1024; const socialImageFixture = Buffer.alloc(15_068); const html = ` ${escapedTitle}

Luca Pîslaru

System Administrator & Full-Stack Developer

Selected builds

Evidence-led project work.

Contact

Discuss systems and software work.

Contact
`; const servers: ReturnType[] = []; afterEach(async () => Promise.all(servers.splice(0).map((server) => new Promise((resolve) => server.close(() => resolve()))))); interface FixtureOptions { html?: string; imageStatus?: number; imageType?: string; imageContentLength?: string | null; imageChunks?: readonly Buffer[]; } const mutateJsonLd = (source: string, mutate: (graph: Record) => void): string => source.replace( /(