auth-yes/src/core/auth_guards.test.ts
google-labs-jules[bot] a613ed2b68 feat: execute Phase 1 architectural hypermedia framework
- Bootstraps `src/core/` foundation (`db.ts`, `valkey.ts`, `spire_ffi.ts`, `main.ts`).
- Adds `auth_guards.ts` for payload capping, CSRF check, and rate limiting.
- Adds `content_negotiation.ts` and `sse_adapter.ts` for Datastar transport helpers.
- Adds `error_fragments.tsx` for standardized Datastar error morphs.
- Introduces `scripts/lint_arch.ts` to block imperative DOM usage.
- Updates `deno.json` with src workspace configs and lint commands.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-28 01:20:01 +00:00

17 lines
524 B
TypeScript

import { assertEquals } from "jsr:@std/assert";
import { determineClientType } from "./content_negotiation.ts";
import { Context } from "jsr:@hono/hono@4";
Deno.test("determineClientType - correctly identifies datastar", () => {
const mockContext = {
req: {
header: (name: string) => {
if (name === "datastar-request") return "true";
return "";
}
}
} as unknown as Context;
assertEquals(determineClientType(mockContext), "datastar");
});