From 50e684e5a7a3d87d2dbf7ddcb8cf8cb624a5c54a Mon Sep 17 00:00:00 2001 From: Roy Anger Date: Wed, 28 Oct 2026 18:41:14 -0400 Subject: [PATCH] test(redact): report each size of the long-run test as its own case Co-Authored-By: Claude Opus 5.5 --- packages/cli-core/src/lib/redact.test.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/cli-core/src/lib/redact.test.ts b/packages/cli-core/src/lib/redact.test.ts index 4bcc36cc9..c3fcdaee9 100644 --- a/packages/cli-core/src/lib/redact.test.ts +++ b/packages/cli-core/src/lib/redact.test.ts @@ -1336,16 +1336,14 @@ describe("secrets right after an escape sequence", () => { }); // Bun's regex engine gives up on a long run without an error and reports no match. -describe("a secret followed by a long run", () => { - test.each([ - ["URL query", (tail: string) => `password=hunter2xyz&data=${tail}`], - ["flag", (tail: string) => `--token hunter2xyz${tail}`], - ["JSON field", (tail: string) => `{"password":"hunter2xyz","data":"${tail}"}`], - ["camelCase name", (tail: string) => `dbPass=hunter2xyz${tail}`], - ])("%s", (_label, shape) => { - for (const size of [10_000, 60_000, 200_000]) { - expect(redact(shape("a".repeat(size))).text).not.toContain("hunter2xyz"); - } +describe.each([ + ["URL query", (tail: string) => `password=hunter2xyz&data=${tail}`], + ["flag", (tail: string) => `--token hunter2xyz${tail}`], + ["JSON field", (tail: string) => `{"password":"hunter2xyz","data":"${tail}"}`], + ["camelCase name", (tail: string) => `dbPass=hunter2xyz${tail}`], +])("a secret followed by a long run: %s", (_label, shape) => { + test.each([10_000, 60_000, 200_000])("%d characters", (size) => { + expect(redact(shape("a".repeat(size))).text).not.toContain("hunter2xyz"); }); });