



















@@ -30,18 +30,27 @@ describe("qa aimock server", () => {
3030}),
3131});
3232expect(response.status).toBe(200);
33-expect(await response.json()).toMatchObject({
34-status: "completed",
35-model: "aimock/gpt-5.5",
36-});
33+const responseBody = (await response.json()) as { model?: unknown; status?: unknown };
34+expect(responseBody.status).toBe("completed");
35+expect(responseBody.model).toBe("aimock/gpt-5.5");
37363837const debug = await fetch(`${server.baseUrl}/debug/last-request`);
3938expect(debug.status).toBe(200);
40-expect(await debug.json()).toMatchObject({
39+const expectedBody = {
40+model: "aimock/gpt-5.5",
41+messages: [{ role: "user", content: "hello aimock" }],
42+stream: false,
43+_endpointType: "chat",
44+};
45+expect(await debug.json()).toEqual({
46+raw: JSON.stringify(expectedBody),
47+body: expectedBody,
4148prompt: "hello aimock",
4249allInputText: "hello aimock",
50+toolOutput: "",
4351model: "aimock/gpt-5.5",
4452providerVariant: "openai",
53+imageInputCount: 0,
4554});
4655} finally {
4756await server.stop();
@@ -64,9 +73,8 @@ describe("qa aimock server", () => {
6473}),
6574});
6675expect(response.status).toBe(200);
67-expect(await response.json()).toMatchObject({
68-status: "completed",
69-});
76+const responseBody = (await response.json()) as { status?: unknown };
77+expect(responseBody.status).toBe("completed");
70787179const debug = await fetch(`${server.baseUrl}/debug/requests`);
7280expect(debug.status).toBe(200);
@@ -112,9 +120,21 @@ describe("qa aimock server", () => {
112120113121const debug = await fetch(`${server.baseUrl}/debug/last-request`);
114122expect(debug.status).toBe(200);
115-expect(await debug.json()).toMatchObject({
123+const expectedBody = {
124+model: "openai-codex/gpt-5.5",
125+messages: [{ role: "user", content: "hello codex-compatible aimock" }],
126+stream: false,
127+_endpointType: "chat",
128+};
129+expect(await debug.json()).toEqual({
130+raw: JSON.stringify(expectedBody),
131+body: expectedBody,
132+prompt: "hello codex-compatible aimock",
133+allInputText: "hello codex-compatible aimock",
134+toolOutput: "",
116135model: "openai-codex/gpt-5.5",
117136providerVariant: "openai",
137+imageInputCount: 0,
118138});
119139} finally {
120140await server.stop();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。