Files
compound-engineering-plugin…/tests/skills/ce-sweep-mode-token.test.ts
fea76d4396 fix: rename mode:headless to mode:non-interactive (#475) (#1291)
Co-authored-by: SomSamantray <>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Trevin Chow <trevin@trevinchow.com>
2026-07-31 13:21:22 -07:00

48 lines
1.4 KiB
TypeScript

import { describe, expect, test } from "bun:test"
import { readFileSync } from "fs"
import path from "path"
const skill = readFileSync(
path.join(import.meta.dir, "..", "..", "skills", "ce-sweep", "SKILL.md"),
"utf8",
)
const interview = readFileSync(
path.join(
import.meta.dir,
"..",
"..",
"skills",
"ce-sweep",
"references",
"interview.md",
),
"utf8",
)
describe("ce-sweep non-interactive mode token contract", () => {
test("advertises mode:non-interactive as the primary unattended token", () => {
expect(skill).toContain('argument-hint: "[setup|reconfigure] [mode:non-interactive]"')
expect(skill).toContain("supports mode:non-interactive for scheduled runs")
})
test("accepts mode:headless as a deprecated alias for scheduled/non-interactive runs", () => {
expect(skill).toMatch(
/Parse a `mode:non-interactive` token or its deprecated alias `mode:headless`/i,
)
expect(skill).toMatch(/Both tokens together is not a conflict/i)
expect(skill).toMatch(
/\*\*Non-interactive\*\* \(either token present\) never prompts/i,
)
})
test("schedule registration prefers mode:non-interactive while documenting the alias", () => {
expect(interview).toMatch(
/registered invocation must include `mode:non-interactive`/i,
)
expect(interview).toMatch(
/deprecated alias `mode:headless` still works if already registered/i,
)
})
})