diff --git a/src/mcplocal/tests/smoke/llm.smoke.test.ts b/src/mcplocal/tests/smoke/llm.smoke.test.ts index d9841a5..2e20b23 100644 --- a/src/mcplocal/tests/smoke/llm.smoke.test.ts +++ b/src/mcplocal/tests/smoke/llm.smoke.test.ts @@ -121,10 +121,16 @@ describe('llm smoke', () => { it('get llms shows the row with KEY column rendered as "secret://name/key"', () => { if (!mcpdUp) return; - const result = run('get llms'); + // Table output truncates the KEY column (≈34 chars), so the full + // "secret:///" string won't appear verbatim in the row. Assert + // against JSON output where the apiKeyRef round-trips as a structured + // object. + const result = run('get llms -o json'); expect(result.code).toBe(0); - expect(result.stdout).toContain(LLM_NAME); - expect(result.stdout).toContain(`secret://${SECRET_NAME}/token`); + const rows = JSON.parse(result.stdout) as Array<{ name: string; apiKeyRef?: { name: string; key: string } }>; + const row = rows.find((r) => r.name === LLM_NAME); + expect(row, `row ${LLM_NAME} must be present`).toBeDefined(); + expect(row!.apiKeyRef).toEqual({ name: SECRET_NAME, key: 'token' }); }); it('round-trips yaml output → apply -f', () => {