Files
app/tauri/src/runtime/artifacts/artifact-content-cache.test.ts
T

14 lines
637 B
TypeScript

import { describe, expect, it } from "vitest";
import { ArtifactContentCache } from "@/runtime/artifacts/artifact-content-cache";
describe("ArtifactContentCache", () => {
it("accepts only host-owned opaque references and never exposes paths", () => {
const cache = new ArtifactContentCache();
expect(cache.put("artifact-cache-001", new Blob(["verified bytes"]))).toBe(true);
expect(cache.has("artifact-cache-001")).toBe(true);
expect(cache.get("artifact-cache-001")?.size).toBe(14);
expect(cache.put("/tmp/report.pdf", new Blob(["x"]))).toBe(false);
expect(cache.has("/tmp/report.pdf")).toBe(false);
});
});