17 lines
489 B
TypeScript
17 lines
489 B
TypeScript
import { assertEquals } from "jsr:@std/assert";
|
|
import { determineClientType } from "./content_negotiation.ts";
|
|
import type { 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");
|
|
});
|