Files
cline/tests/e2e/cli/version.test.ts
T
MaxandMax Paulus 🥪 a27bedffb6 max/cli tui e2e tests (#9753)
* 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>
2026-03-12 16:06:25 -07:00

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])
})
})