특정 uid로 실제 도구·모델 루프를 돌려 호출된 도구·토큰·속도·캐시 히트를 보고하는 /debug/chatToolsSheet, /debug/chatProbe(Sheet) 엔드포인트를 추가한다 (요청별 model 오버라이드로 A/B 가능). prod에 같은 검증을 돌리는 scripts/chat-tools-sheet.ts도 추가한다. 무인증 + 임의 uid의 개인 데이터를 노출하는 검수용 임시 엔드포인트다.
29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { buildSheetMatrix, runChatToolsSheet } from "../../src/services/chatToolsSheetService";
|
|
|
|
describe("chatToolsSheetService", () => {
|
|
describe("buildSheetMatrix — 케이스 매트릭스", () => {
|
|
it("기본 13개 케이스를 만든다", () => {
|
|
const m = buildSheetMatrix();
|
|
expect(m).toHaveLength(13);
|
|
expect(m.every((c) => typeof c.tool === "string" && typeof c.label === "string")).toBe(true);
|
|
});
|
|
|
|
it("date 옵션은 라인업·활약·예측 복기 3개를 추가한다", () => {
|
|
expect(buildSheetMatrix({ date: "2026-05-01" })).toHaveLength(16);
|
|
});
|
|
|
|
it("player 옵션은 선수 활약 검증 케이스를 추가한다", () => {
|
|
const m = buildSheetMatrix({ player: "양의지" });
|
|
expect(m).toHaveLength(14);
|
|
expect(m.some((c) => c.tool === "get_game_standouts" && c.args.player === "양의지")).toBe(true);
|
|
});
|
|
});
|
|
|
|
describe("runChatToolsSheet — 유저 경계", () => {
|
|
it("유저 문서가 없으면 404를 던진다(도구 호출 이전 단계)", async () => {
|
|
await expect(runChatToolsSheet("nonexistent-uid-xyz")).rejects.toMatchObject({ status: 404 });
|
|
});
|
|
});
|
|
});
|