version.test.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { test } from "@microsoft/tui-test"
  2. import { CLINE_BIN } from "./helpers/constants.js"
  3. import { expectVisible, testEnv } from "./utils.js"
  4. // ---------------------------------------------------------------------------
  5. // cline --version (root flag)
  6. // ---------------------------------------------------------------------------
  7. test.describe("cline --version", () => {
  8. test.use({
  9. program: { file: CLINE_BIN, args: ["--version"] },
  10. env: testEnv("claude-sonnet-4.6"),
  11. })
  12. test("prints the version string", async ({ terminal }) => {
  13. await expectVisible(terminal, /\d+\.\d+\.\d+/g)
  14. })
  15. })
  16. // ---------------------------------------------------------------------------
  17. // cline -V (short flag)
  18. // ---------------------------------------------------------------------------
  19. test.describe("cline -V", () => {
  20. test.use({
  21. program: { file: CLINE_BIN, args: ["-V"] },
  22. env: testEnv("claude-sonnet-4.6"),
  23. })
  24. test("prints the version string with short flag", async ({ terminal }) => {
  25. await expectVisible(terminal, /\d+\.\d+\.\d+/g)
  26. })
  27. })
  28. // ---------------------------------------------------------------------------
  29. // cline version (subcommand)
  30. // ---------------------------------------------------------------------------
  31. test.describe("cline version subcommand", () => {
  32. test.use({
  33. program: { file: CLINE_BIN, args: ["version"] },
  34. env: testEnv("claude-sonnet-4.6"),
  35. })
  36. test("prints 'Cline CLI version:' message", async ({ terminal }) => {
  37. await expectVisible(terminal, ["Cline CLI version:", /\d+\.\d+\.\d+/g])
  38. })
  39. })