- Add `app` export and wrap startup logic behind `if (import.meta.main)` - Extract `hono` middleware into `sdk/hono.ts` for clean separation - Refactor module imports slightly to support in-memory native mocking (`db`, `valkey`, `spire_ffi`, `ratelimit`, `audit`) - Implement comprehensive native Deno mock tests in `server/main.test.ts` - Fix type checking across project files Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
13 lines
480 B
TypeScript
13 lines
480 B
TypeScript
import { assertEquals } from "jsr:@std/assert";
|
|
import { extractSpiffeIdFromCert, fetchSpiffeIdentity } from "./spire_ffi.ts";
|
|
|
|
Deno.test("SPIRE FFI Test - fetchSpiffeIdentity mock", async () => {
|
|
const result = await fetchSpiffeIdentity();
|
|
assertEquals(result.spiffe_id, "spiffe://local.dev/mock");
|
|
});
|
|
|
|
Deno.test("SPIRE FFI Test - extractSpiffeIdFromCert null case", () => {
|
|
const result = extractSpiffeIdFromCert("invalid-cert-string");
|
|
assertEquals(result, null);
|
|
});
|