Files
gemini-cli/packages/cli/src/commands/extensions/install.test.ts
T

30 lines
907 B
TypeScript
Raw Normal View History

/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
2025-09-08 21:59:45 -07:00
import { installCommand } from './install.js';
import yargs from 'yargs';
vi.mock('../../config/extension.js', () => ({
installExtension: vi.fn(),
}));
describe('extensions install command', () => {
it('should fail if no source is provided', () => {
const validationParser = yargs([]).command(installCommand).fail(false);
expect(() => validationParser.parse('install')).toThrow(
'Either source or --path must be provided.',
);
});
it('should fail if both git source and local path are provided', () => {
const validationParser = yargs([]).command(installCommand).fail(false);
expect(() =>
validationParser.parse('install some-url --path /some/path'),
).toThrow('Arguments source and path are mutually exclusive');
});
});