diff --git a/tests/audit/mobile-audit.ts b/tests/audit/mobile-audit.ts index ebe79dea..5b93d8d6 100644 --- a/tests/audit/mobile-audit.ts +++ b/tests/audit/mobile-audit.ts @@ -14,6 +14,7 @@ * Usage: bun run tests/audit/mobile-audit.ts * Env: AUDIT_BASE_URL (default http://localhost:3000) * AUDIT_USER / AUDIT_PASS (default dev / Test123) + * AUDIT_ROUTE_FILTER (substring match, or "=/route" for an exact match) * E2E_BROWSER_PATH (browser executable override) * * Outputs tests/audit/mobile-audit-report.json (regression gate artifact for @@ -417,7 +418,11 @@ async function main() { routes.push(`/wiki/category/${encodeURIComponent(category || "general")}`); console.log(`Auditing ${routes.length} routes at ${VIEWPORT.width}x${VIEWPORT.height} against ${BASE_URL}`); - const auditedRoutes = ROUTE_FILTER ? routes.filter((r) => r.includes(ROUTE_FILTER)) : routes; + const auditedRoutes = ROUTE_FILTER + ? routes.filter((r) => + ROUTE_FILTER.startsWith("=") ? r === ROUTE_FILTER.slice(1) : r.includes(ROUTE_FILTER), + ) + : routes; if (ROUTE_FILTER) { // Targeted run: drop pre-seeded skips that did not match the filter. results.length = 0;