diff --git a/test/cli.test.ts b/test/cli.test.ts index cd45a27..e0b06cc 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -275,12 +275,11 @@ describe.skipIf(skipTests)('CLI Integration Tests', () => { const listResult = runCli('buckets list --format json'); if (listResult.exitCode === 0 && listResult.stdout.trim()) { try { - const buckets = JSON.parse(listResult.stdout.trim()) as Array<{ - name: string; - created: string; - }>; + const parsed = JSON.parse(listResult.stdout.trim()) as { + items: Array<{ name: string; created: string }>; + }; const now = Date.now(); - for (const bucket of buckets) { + for (const bucket of parsed.items) { if (!bucket.name.startsWith('tigris-cli-test-')) continue; const age = now - new Date(bucket.created).getTime(); if (age > staleThresholdMs) { @@ -1156,10 +1155,10 @@ describe.skipIf(skipTests)('CLI Integration Tests', () => { const result = runCli('buckets list --format json'); expect(result.exitCode).toBe(0); const parsed = JSON.parse(result.stdout.trim()); - expect(Array.isArray(parsed)).toBe(true); - expect(parsed.some((b: { name: string }) => b.name === testBucket)).toBe( - true - ); + expect(Array.isArray(parsed.items)).toBe(true); + expect( + parsed.items.some((b: { name: string }) => b.name === testBucket) + ).toBe(true); }); }); @@ -1810,10 +1809,10 @@ describe.skipIf(skipTests)('CLI Integration Tests', () => { const result = runCli(`snapshots list ${snapBucket} --format json`); expect(result.exitCode).toBe(0); const parsed = JSON.parse(result.stdout.trim()); - expect(Array.isArray(parsed)).toBe(true); - expect(parsed.length).toBeGreaterThan(0); + expect(Array.isArray(parsed.items)).toBe(true); + expect(parsed.items.length).toBeGreaterThan(0); // Save version for later tests - snapshotVersion = parsed[0].version; + snapshotVersion = parsed.items[0].version; expect(snapshotVersion).toBeTruthy(); });