mirror of
https://github.com/cline/cline.git
synced 2026-10-30 18:12:49 +08:00
* add tui UI tests using microsoft/tui-test library, can run many headless versions of cline and execute ui tests (requires Node <= 20) improve brittle sleep calls * add cli-tui-tests github action --------- Co-authored-by: Max Paulus 🥪 <max@cline.bot>
46 lines
1.5 KiB
TypeScript
46 lines
1.5 KiB
TypeScript
import { test } from "@microsoft/tui-test"
|
|
import { CLINE_BIN } from "./helpers/constants.js"
|
|
import { expectVisible, testEnv } from "./utils.js"
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// cline --version (root flag)
|
|
// ---------------------------------------------------------------------------
|
|
test.describe("cline --version", () => {
|
|
test.use({
|
|
program: { file: CLINE_BIN, args: ["--version"] },
|
|
env: testEnv("claude-sonnet-4.6"),
|
|
})
|
|
|
|
test("prints the version string", async ({ terminal }) => {
|
|
await expectVisible(terminal, /\d+\.\d+\.\d+/g)
|
|
})
|
|
})
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// cline -V (short flag)
|
|
// ---------------------------------------------------------------------------
|
|
test.describe("cline -V", () => {
|
|
test.use({
|
|
program: { file: CLINE_BIN, args: ["-V"] },
|
|
env: testEnv("claude-sonnet-4.6"),
|
|
})
|
|
|
|
test("prints the version string with short flag", async ({ terminal }) => {
|
|
await expectVisible(terminal, /\d+\.\d+\.\d+/g)
|
|
})
|
|
})
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// cline version (subcommand)
|
|
// ---------------------------------------------------------------------------
|
|
test.describe("cline version subcommand", () => {
|
|
test.use({
|
|
program: { file: CLINE_BIN, args: ["version"] },
|
|
env: testEnv("claude-sonnet-4.6"),
|
|
})
|
|
|
|
test("prints 'Cline CLI version:' message", async ({ terminal }) => {
|
|
await expectVisible(terminal, ["Cline CLI version:", /\d+\.\d+\.\d+/g])
|
|
})
|
|
})
|