修复 TypeScript 基线并补齐测试类型
This commit is contained in:
@@ -22,6 +22,7 @@ import { getAuthUserId } from "@/lib/auth";
|
||||
const mockSuggestAlternativeItems = vi.mocked(suggestAlternativeItems);
|
||||
const mockSearchPois = vi.mocked(searchPois);
|
||||
const mockGetAuthUserId = vi.mocked(getAuthUserId);
|
||||
const mockCtx = { params: Promise.resolve({}) };
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
@@ -35,7 +36,7 @@ describe("POST /api/blindbox/plan/suggest-item", () => {
|
||||
method: "POST",
|
||||
body: { activity: "看展" },
|
||||
});
|
||||
const res = await POST(req);
|
||||
const res = await POST(req, mockCtx);
|
||||
expect(res.status).toBe(401);
|
||||
});
|
||||
|
||||
@@ -65,7 +66,7 @@ describe("POST /api/blindbox/plan/suggest-item", () => {
|
||||
location: "121.47,31.23",
|
||||
},
|
||||
});
|
||||
const res = await POST(req);
|
||||
const res = await POST(req, mockCtx);
|
||||
const { status, data } = await parseJsonResponse(res);
|
||||
|
||||
expect(status).toBe(200);
|
||||
|
||||
Reference in New Issue
Block a user