Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

test(progress): cover live dispatch after a fenced example (#526)

Sylvester Kaczmarek8faac059c603
diff --git a/sdk/typescript/tests-ts/worker-progress.test.ts b/sdk/typescript/tests-ts/worker-progress.test.ts
index bdbe334ee..2fc9604c3 100644
--- a/sdk/typescript/tests-ts/worker-progress.test.ts
+++ b/sdk/typescript/tests-ts/worker-progress.test.ts
@@ -250,6 +250,27 @@ describe("worker progress events", () => {
messageEvent(["Example:", "```text", dispatchMarker, "```"].join("\n")),
),
).toBeNull();
+
+ const liveDispatch = {
+ phase: "validation",
+ planned: 2,
+ started: 2,
+ } as const;
+ const message = messageEvent(
+ [
+ "~~~text",
+ progressMarker,
+ dispatchMarker,
+ "~~~",
+ liveMarker,
+ `CODEX_SECURITY_WORKER_STATUS ${JSON.stringify(liveDispatch)}`,
+ ].join("\n"),
+ );
+ expect(scanProgressUpdatesFromEvent(message)).toEqual([liveProgress]);
+ expect(workerStatusFromEvent(message)).toEqual({
+ kind: "dispatch",
+ ...liveDispatch,
+ });
});
test("rejects malformed or overstated file progress", () => {