Skip to content

Commit 855df4f

Browse files
committed
fix: integration tests
1 parent 602cb44 commit 855df4f

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

tests/integration/auth.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ describe("auth commands", () => {
8484
});
8585

8686
it("preserves other config values", () => {
87-
// Login with a key
88-
runCli(["login", `--api-key=test-key`]);
87+
// Login with a valid key
88+
const apiKey = process.env.CERTMAN_API_KEY!;
89+
runCli(["login", `--api-key=${apiKey}`]);
8990

9091
// Manually add another config value
9192
const config = JSON.parse(readFileSync(configPath, "utf-8"));

tests/integration/cert.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ describe("cert commands", () => {
2020
const result = runCliWithApiKey(["cert", "list"]);
2121

2222
expect(result.exitCode).toBe(0);
23-
expect(result.stdout).toContain("ID");
24-
expect(result.stdout).toContain("COMMON NAME");
23+
// Output can be either a table with headers or "No results found" for empty list
24+
const hasTableHeaders =
25+
result.stdout.includes("ID") && result.stdout.includes("COMMON NAME");
26+
const hasEmptyMessage = result.stdout.includes("No results found");
27+
expect(hasTableHeaders || hasEmptyMessage).toBe(true);
2528
});
2629

2730
it("returns JSON when --json flag is set", () => {

0 commit comments

Comments
 (0)