mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 11:34:44 -07:00
26 lines
849 B
TypeScript
26 lines
849 B
TypeScript
|
|
/**
|
||
|
|
* @license
|
||
|
|
* Copyright 2025 Google LLC
|
||
|
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
|
*/
|
||
|
|
|
||
|
|
import { describe, it, expect } from 'vitest';
|
||
|
|
import { installCommand } from './install.js';
|
||
|
|
import yargs from 'yargs';
|
||
|
|
|
||
|
|
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 a git URL --source or a --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 --source some-url --path /some/path'),
|
||
|
|
).toThrow('Arguments source and path are mutually exclusive');
|
||
|
|
});
|
||
|
|
});
|