import { describe, expect, it } from "vitest"; import { parseTestCommandTail } from "./parse-test-command-tail.ts"; describe("parseTestCommandTail", () => { it("preserves an empty command tail", () => { expect(parseTestCommandTail("")).toEqual({ runArgsTail: "", showOutput: false, showComments: false, }); }); it("removes --info and enables command output", () => { expect(parseTestCommandTail("--info")).toEqual({ runArgsTail: "", showOutput: true, showComments: false, }); }); it("preserves Go build tag arguments while removing --info", () => { expect(parseTestCommandTail("--tags contract,e2e --info")).toEqual({ runArgsTail: "--tags contract,e2e", showOutput: true, showComments: false, }); }); it("preserves equals-style Go build tag arguments while removing --info", () => { expect(parseTestCommandTail("--tags=contract,e2e --info")).toEqual({ runArgsTail: "--tags=contract,e2e", showOutput: true, showComments: false, }); }); it("preserves bare Go build tags while removing --info", () => { expect(parseTestCommandTail("contract,e2e --info")).toEqual({ runArgsTail: "contract,e2e", showOutput: true, showComments: false, }); }); it("accepts --info before the Go test arguments", () => { expect(parseTestCommandTail("--info --tags contract,e2e")).toEqual({ runArgsTail: "--tags contract,e2e", showOutput: true, showComments: false, }); }); it("removes --comment and enables test comments", () => { expect(parseTestCommandTail("--comment")).toEqual({ runArgsTail: "", showOutput: false, showComments: true, }); }); it("supports --comment together with --info", () => { expect(parseTestCommandTail("--comment --info")).toEqual({ runArgsTail: "", showOutput: true, showComments: true, }); }); it("preserves Go build tag arguments while removing --comment", () => { expect(parseTestCommandTail("--comment --tags contract,e2e")).toEqual({ runArgsTail: "--tags contract,e2e", showOutput: false, showComments: true, }); }); });