import fs from "node:fs"; import path from "node:path"; function assert(condition: unknown, message: string) { if (!condition) throw new Error(message); } export function runTests() { const projectRoot = process.cwd(); const dashboardSource = fs.readFileSync( path.join(projectRoot, "components", "dashboard", "ScanTerminalDashboard.tsx"), "utf8", ); const chartSource = fs.readFileSync( path.join(projectRoot, "components", "dashboard", "scan-terminal", "LiveTemperatureThresholdChart.tsx"), "utf8", ); const modalPath = path.join(projectRoot, "components", "dashboard", "scan-terminal", "UserFeedbackModal.tsx"); const statusButtonPath = path.join(projectRoot, "components", "dashboard", "scan-terminal", "UserFeedbackStatusButton.tsx"); const opsSidebarSource = fs.readFileSync( path.join(projectRoot, "components", "ops", "layout", "AdminSidebar.tsx"), "utf8", ); const opsApiSource = fs.readFileSync(path.join(projectRoot, "lib", "ops-api.ts"), "utf8"); const feedbackRouteSource = fs.readFileSync(path.join(projectRoot, "app", "api", "feedback", "route.ts"), "utf8"); assert(fs.existsSync(modalPath), "terminal must ship a user feedback modal component"); assert(fs.existsSync(statusButtonPath), "terminal must ship a user-facing feedback status notification component"); const modalSource = fs.readFileSync(modalPath, "utf8"); const statusButtonSource = fs.readFileSync(statusButtonPath, "utf8"); const statusHelperSource = fs.readFileSync( path.join(projectRoot, "components", "dashboard", "scan-terminal", "feedback-status.ts"), "utf8", ); assert( dashboardSource.includes("onFeedbackClick") && dashboardSource.includes("