import { mkdir } from "node:fs/promises"; import { automatedA11yArtifactSchema } from "./contracts/release-artifacts.ts"; import { automatedA11yReport, readA11yNotCheckedRoutes, } from "./lib/a11y-data-state.ts"; import { MANUAL_A11Y_ROUTE_IDS } from "./lib/manual-a11y-evidence.ts"; import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts"; await mkdir("artifacts/tests", { recursive: true }); // 1103/11-01. Routes the spec scanned only on their failure state are not // reported as passed. const notChecked = await readA11yNotCheckedRoutes(MANUAL_A11Y_ROUTE_IDS); await writeValidatedJsonArtifact({ path: "artifacts/tests/a11y.json", schema: automatedA11yArtifactSchema, value: automatedA11yReport({ routeIds: MANUAL_A11Y_ROUTE_IDS, notChecked, generatedAt: new Date().toISOString(), }), }); for (const { routeId, reason } of notChecked) { process.stdout.write(`a11y: ${routeId} not checked in its own state (${reason})\n`); }