test: tighten gateway response assertions

This commit is contained in:
Peter Steinberger
2026-05-11 12:54:21 +01:00
parent 85d5718236
commit a199ddf995
3 changed files with 8 additions and 8 deletions

View File

@@ -94,7 +94,7 @@ describe("completion-cli write-state", () => {
await program.parseAsync(["completion", "--write-state"], { from: "user" });
const cacheDir = path.join(stateDir, "completions");
expect((await fs.readdir(cacheDir)).sort()).toEqual([
expect((await fs.readdir(cacheDir)).toSorted()).toEqual([
"openclaw.bash",
"openclaw.fish",
"openclaw.ps1",
@@ -137,7 +137,7 @@ describe("completion-cli write-state", () => {
[program, "qa", process.argv, { purpose: "completion" }],
]);
expect(registerPluginCliCommandsFromValidatedConfigMock).not.toHaveBeenCalled();
expect((await fs.readdir(path.join(stateDir, "completions"))).sort()).toEqual([
expect((await fs.readdir(path.join(stateDir, "completions"))).toSorted()).toEqual([
"openclaw.bash",
"openclaw.fish",
"openclaw.ps1",

View File

@@ -124,10 +124,8 @@ describe("gateway stability lane", () => {
expect(lastSeq).toBeGreaterThan(firstSeq);
expect(snapshot.summary.byType["diagnostic.memory.sample"]).toBeGreaterThan(0);
expect(snapshot.summary.byType["message.queued"]).toBeGreaterThan(0);
expect(snapshot.summary.memory).toMatchObject({
maxRssBytes: maxSyntheticRssBytes,
pressureCount: 0,
});
expect(snapshot.summary.memory?.maxRssBytes).toBe(maxSyntheticRssBytes);
expect(snapshot.summary.memory?.pressureCount).toBe(0);
expect(snapshot.summary.memory?.maxHeapUsedBytes).toBeLessThan(96 * MB);
expect(snapshot.summary.payloadLarge?.chunked).toBeGreaterThan(0);
expect(snapshot.summary.payloadLarge?.bySurface["gateway.stability.probe"]).toBeGreaterThan(0);

View File

@@ -58,10 +58,11 @@ describe("openresponses phase support", () => {
phase: "commentary",
status: "completed",
}),
).toMatchObject({
).toEqual({
type: "message",
id: "msg_commentary",
role: "assistant",
content: [{ type: "output_text", text: "Checking logs." }],
phase: "commentary",
status: "completed",
});
@@ -73,10 +74,11 @@ describe("openresponses phase support", () => {
phase: "final_answer",
status: "completed",
}),
).toMatchObject({
).toEqual({
type: "message",
id: "msg_final",
role: "assistant",
content: [{ type: "output_text", text: "Root cause found." }],
phase: "final_answer",
status: "completed",
});