mirror of
https://github.com/openai/codex.git
synced 2026-04-24 22:54:54 +00:00
fix tests
This commit is contained in:
@@ -58,7 +58,8 @@ describe.each([
|
||||
await loop.run([
|
||||
{
|
||||
type: "message",
|
||||
content: [{ type: "text", text: "hello" }],
|
||||
role: "user",
|
||||
content: [{ type: "input_text", text: "hello" }],
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -69,23 +70,17 @@ describe.each([
|
||||
if (flag) {
|
||||
/* behaviour when ZDR is *on* */
|
||||
expect(payload).not.toHaveProperty("previous_response_id");
|
||||
if (payload.input) {
|
||||
payload.input.forEach((m: any) =>
|
||||
expect(m.store === undefined ? false : m.store).toBe(false),
|
||||
);
|
||||
}
|
||||
payload.input?.forEach((m: any) =>
|
||||
expect(m.store === undefined ? false : m.store).toBe(false),
|
||||
);
|
||||
} else {
|
||||
/* behaviour when ZDR is *off* */
|
||||
expect(payload).toHaveProperty("previous_response_id");
|
||||
if (payload.input) {
|
||||
// first user message is usually non-stored; assistant messages will be stored
|
||||
// so here we just assert the property is not forcibly set to false
|
||||
payload.input.forEach((m: any) => {
|
||||
if ("store" in m) {
|
||||
expect(m.store).not.toBe(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
payload.input?.forEach((m: any) => {
|
||||
if ("store" in m) {
|
||||
expect(m.store).not.toBe(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import { describe, it, expect, beforeAll, afterAll } from "vitest";
|
||||
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { mkdtempSync, rmSync, writeFileSync, mkdirSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { tmpdir } from "node:os";
|
||||
|
||||
@@ -17,7 +17,7 @@ describe("disableResponseStorage persistence", () => {
|
||||
beforeAll(() => {
|
||||
// mkdir -p ~/.codex inside the sandbox
|
||||
rmSync(codexDir, { recursive: true, force: true });
|
||||
require("fs").mkdirSync(codexDir, { recursive: true });
|
||||
mkdirSync(codexDir, { recursive: true });
|
||||
|
||||
// seed YAML with ZDR enabled
|
||||
writeFileSync(yamlPath, "model: o4-mini\ndisableResponseStorage: true\n");
|
||||
|
||||
Reference in New Issue
Block a user