From dda1bc12067f3bb962e235fffc821e4f5bb27ab5 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Sat, 2 May 2026 01:21:36 +0200 Subject: [PATCH] test: make uok-gitops-wiring assertion whitespace-tolerant The test was checking for a literal single-line ternary in auto-post-unit.ts, but the formatter naturally renders the same ternary multi-line. The semantic content is identical; the test was failing on whitespace alone. Normalize runs of whitespace before substring-matching so the assertion survives prettier/biome formatting changes. After this fix: 39/39 uok tests pass. Co-Authored-By: Claude Sonnet 4.6 --- .../extensions/sf/tests/uok-gitops-wiring.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/resources/extensions/sf/tests/uok-gitops-wiring.test.ts b/src/resources/extensions/sf/tests/uok-gitops-wiring.test.ts index c1705d481..77e89b82c 100644 --- a/src/resources/extensions/sf/tests/uok-gitops-wiring.test.ts +++ b/src/resources/extensions/sf/tests/uok-gitops-wiring.test.ts @@ -9,8 +9,13 @@ const sfDir = join(__dirname, ".."); test("post-unit pre-verification selects turn git action from UOK gitops flags", () => { const source = readFileSync(join(sfDir, "auto-post-unit.ts"), "utf-8"); + // Whitespace-tolerant: collapse runs of whitespace before substring-matching + // so the assertion survives formatter changes (single-line vs multi-line + // ternary). The semantic check is that turnAction is derived from + // uokFlags.gitops + uokFlags.gitopsTurnAction with a "commit" fallback. + const normalized = source.replace(/\s+/g, " "); assert.ok( - source.includes( + normalized.includes( 'const turnAction: TurnGitActionMode = uokFlags.gitops ? uokFlags.gitopsTurnAction : "commit"', ), "postUnitPreVerification should derive turn action from uok.gitops.turn_action when enabled",