import { describe, expect, it } from "vitest"; import { ServerInstructions } from "../server-instructions.js"; describe("ServerInstructions", () => { it("시크릿 키를 서버 전용으로 못박고 공개 접두어 env 를 이름으로 금지한다", () => { expect(ServerInstructions).toContain("test_sk_*"); expect(ServerInstructions).toContain("live_sk_*"); expect(ServerInstructions).toContain("서버 코드에서만"); for (const prefix of [ "NEXT_PUBLIC_", "VITE_", "REACT_APP_", "EXPO_PUBLIC_", ]) { expect(ServerInstructions).toContain(prefix); } }); it("서버 API 를 브라우저에서 직접 호출하지 않도록 한다", () => { expect(ServerInstructions).toContain("api.tosspayments.com"); expect(ServerInstructions).toContain("직접 호출하지 않는다"); }); it("세션마다 상시 점유하는 텍스트라 짧게 유지한다", () => { // 참고: tool description 전체는 4,648자(#34). instructions 는 그 1/10 안쪽으로 묶는다. expect(ServerInstructions.length).toBeLessThan(500); }); });