Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
});
});

Expand Down Expand Up @@ -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();
});

Expand Down