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 <noreply@anthropic.com>
This commit is contained in:
parent
9c20ebd76b
commit
dda1bc1206
1 changed files with 6 additions and 1 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue