Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions test/commands/auth/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('auth login command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -31,7 +31,7 @@ describe('auth login command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('--api-key is required');
Expand Down
4 changes: 2 additions & 2 deletions test/commands/auth/logout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('auth logout command', () => {
noColor: true,
yes: false,
dryRun: true,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -33,7 +33,7 @@ describe('auth logout command', () => {
yes: false,
dryRun: true,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
});

Expand Down
4 changes: 2 additions & 2 deletions test/commands/auth/refresh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('auth refresh command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -29,7 +29,7 @@ describe('auth refresh command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('not authenticated via OAuth');
Expand Down
4 changes: 2 additions & 2 deletions test/commands/auth/status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('auth status command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -33,7 +33,7 @@ describe('auth status command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
});

Expand Down
8 changes: 4 additions & 4 deletions test/commands/config/set.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('config set command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -29,7 +29,7 @@ describe('config set command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('--key and --value are required');
Expand All @@ -46,7 +46,7 @@ describe('config set command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -60,7 +60,7 @@ describe('config set command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('Invalid config key');
Expand Down
4 changes: 2 additions & 2 deletions test/commands/config/show.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('config show command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -34,7 +34,7 @@ describe('config show command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
});

Expand Down
38 changes: 38 additions & 0 deletions test/commands/file/upload.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { describe, it, expect } from 'bun:test';
import { default as uploadCommand } from '../../../src/commands/file/upload';

describe('file upload command', () => {
it('has correct name', () => {
expect(uploadCommand.name).toBe('file upload');
});

it('requires file argument', async () => {
const config = {
apiKey: 'test-key',
region: 'global' as const,
baseUrl: 'https://api.minimax.io',
output: 'text' as const,
timeout: 10,
verbose: false,
quiet: false,
noColor: true,
yes: false,
dryRun: true,
nonInteractive: true,
async: false,
};

await expect(
uploadCommand.execute(config, {
quiet: false,
verbose: false,
noColor: true,
yes: false,
dryRun: true,
help: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('Missing required argument: --file');
});
});
4 changes: 2 additions & 2 deletions test/commands/image/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('image generate command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -30,7 +30,7 @@ describe('image generate command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('Missing required argument: --prompt');
Expand Down
4 changes: 2 additions & 2 deletions test/commands/quota/show.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('quota show command', () => {
noColor: true,
yes: false,
dryRun: true,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -34,7 +34,7 @@ describe('quota show command', () => {
yes: false,
dryRun: true,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
});

Expand Down
38 changes: 38 additions & 0 deletions test/commands/search/query.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { describe, it, expect } from 'bun:test';
import { default as queryCommand } from '../../../src/commands/search/query';

describe('search query command', () => {
it('has correct name', () => {
expect(queryCommand.name).toBe('search query');
});

it('requires q argument', async () => {
const config = {
apiKey: 'test-key',
region: 'global' as const,
baseUrl: 'https://api.minimax.io',
output: 'text' as const,
timeout: 10,
verbose: false,
quiet: false,
noColor: true,
yes: false,
dryRun: true,
nonInteractive: true,
async: false,
};

await expect(
queryCommand.execute(config, {
quiet: false,
verbose: false,
noColor: true,
yes: false,
dryRun: true,
help: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('--q is required');
});
});
8 changes: 4 additions & 4 deletions test/commands/speech/synthesize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('speech synthesize command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -30,7 +30,7 @@ describe('speech synthesize command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('--text or --text-file is required');
Expand All @@ -48,7 +48,7 @@ describe('speech synthesize command', () => {
noColor: true,
yes: false,
dryRun: true,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -65,7 +65,7 @@ describe('speech synthesize command', () => {
yes: false,
dryRun: true,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
});

Expand Down
8 changes: 4 additions & 4 deletions test/commands/text/chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('text chat command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -50,7 +50,7 @@ describe('text chat command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
});

Expand All @@ -74,7 +74,7 @@ describe('text chat command', () => {
noColor: true,
yes: false,
dryRun: true,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -91,7 +91,7 @@ describe('text chat command', () => {
yes: false,
dryRun: true,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
});

Expand Down
8 changes: 4 additions & 4 deletions test/commands/video/download.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('video download command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -30,7 +30,7 @@ describe('video download command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('--file-id is required');
Expand All @@ -48,7 +48,7 @@ describe('video download command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -61,7 +61,7 @@ describe('video download command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('--out is required');
Expand Down
4 changes: 2 additions & 2 deletions test/commands/video/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('video generate command', () => {
noColor: true,
yes: false,
dryRun: false,
nonInteractive: false,
nonInteractive: true,
async: false,
};

Expand All @@ -30,7 +30,7 @@ describe('video generate command', () => {
yes: false,
dryRun: false,
help: false,
nonInteractive: false,
nonInteractive: true,
async: false,
}),
).rejects.toThrow('Missing required argument: --prompt');
Expand Down
Loading