File size: 642 Bytes
b152fd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { Command } from "commander";
import { describe, expect, it } from "vitest";
import { registerClientAuthCommands } from "../commands/client/auth.js";

describe("registerClientAuthCommands", () => {
  it("registers auth commands without duplicate company-id flags", () => {
    const program = new Command();
    const auth = program.command("auth");

    expect(() => registerClientAuthCommands(auth)).not.toThrow();

    const login = auth.commands.find((command) => command.name() === "login");
    expect(login).toBeDefined();
    expect(login?.options.filter((option) => option.long === "--company-id")).toHaveLength(1);
  });
});