fix(cli/boulder): strip ANSI in formatter test so FORCE_COLOR CI passes
picocolors emits ANSI escape codes when FORCE_COLOR is set (GitHub
Actions default), so the literal toContain('status: active') assertion
fails against the wrapped 'status: \x1b[36mactive\x1b[39m' output.
Reuse the existing stripAnsi helper from src/cli/doctor/format-shared.ts
in the test before assertion.
Reproduced locally with FORCE_COLOR=1 bun test src/cli/boulder/formatter.test.ts.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { describe, expect, it } from "bun:test"
|
||||
|
||||
import { stripAnsi } from "../doctor/format-shared"
|
||||
import { formatJsonOutput, formatTextOutput } from "./formatter"
|
||||
import type { BoulderCliResult } from "./types"
|
||||
|
||||
@@ -28,7 +29,7 @@ describe("boulder formatter", () => {
|
||||
],
|
||||
}
|
||||
|
||||
const textOutput = formatTextOutput(result)
|
||||
const textOutput = stripAnsi(formatTextOutput(result))
|
||||
expect(textOutput).toContain("boulder progress")
|
||||
expect(textOutput).toContain("plan: alpha")
|
||||
expect(textOutput).toContain("status: active")
|
||||
|
||||
Reference in New Issue
Block a user