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(sdk): expect canceled lifecycle for aborted component scans (#2339)

Michael D'Angelo0d18384c8fb4
diff --git a/sdk/typescript/tests-ts/component-scan.test.ts b/sdk/typescript/tests-ts/component-scan.test.ts
index 7504387be..35bf2c910 100644
--- a/sdk/typescript/tests-ts/component-scan.test.ts
+++ b/sdk/typescript/tests-ts/component-scan.test.ts
@@ -473,7 +473,7 @@ test("bounds standard scans, continues after failure, and preserves partial resu
});
test.each([true, false])(
- "saves the registered scan ID for failed components (lifecycle observer: %p)",
+ "keeps the registered scan ID on a failed receipt when the component client aborts (lifecycle observer: %p)",
async (observe) => {
const paths = await fixture();
const controller = new AbortController();
@@ -506,7 +506,7 @@ test.each([true, false])(
expect(typeof receipt.scanId).toBe("string");
expect(events.filter((event) => event.type === "lifecycle")).toMatchObject(
observe
- ? ["running", "failed"].map((status) => ({
+ ? ["running", "canceled"].map((status) => ({
componentId: receipt.id,
value: { status, scanId: receipt.scanId },
}))