mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 22:44:45 -07:00
feat: launch Gemini 3 in Gemini CLI 🚀🚀🚀 (in main) (#13287)
Co-authored-by: Adam Weidman <65992621+adamfweidman@users.noreply.github.com> Co-authored-by: Sehoon Shon <sshon@google.com> Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com> Co-authored-by: Sandy Tao <sandytao520@icloud.com> Co-authored-by: Abhi <43648792+abhipatel12@users.noreply.github.com> Co-authored-by: Aishanee Shah <aishaneeshah@gmail.com> Co-authored-by: gemini-cli-robot <gemini-cli-robot@google.com> Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com> Co-authored-by: Jacob Richman <jacob314@gmail.com> Co-authored-by: joshualitt <joshualitt@google.com> Co-authored-by: Jenna Inouye <jinouye@google.com>
This commit is contained in:
@@ -47,6 +47,13 @@ describe('ide-installer', () => {
|
||||
expect(installer).not.toBeNull();
|
||||
expect(installer?.install).toEqual(expect.any(Function));
|
||||
});
|
||||
|
||||
it('returns an AntigravityInstaller for "antigravity"', () => {
|
||||
const installer = getIdeInstaller(IDE_DEFINITIONS.antigravity);
|
||||
|
||||
expect(installer).not.toBeNull();
|
||||
expect(installer?.install).toEqual(expect.any(Function));
|
||||
});
|
||||
});
|
||||
|
||||
describe('VsCodeInstaller', () => {
|
||||
@@ -188,3 +195,59 @@ describe('ide-installer', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('AntigravityInstaller', () => {
|
||||
function setup({
|
||||
execSync = () => '',
|
||||
platform = 'linux' as NodeJS.Platform,
|
||||
}: {
|
||||
execSync?: () => string;
|
||||
platform?: NodeJS.Platform;
|
||||
} = {}) {
|
||||
vi.spyOn(child_process, 'execSync').mockImplementation(execSync);
|
||||
const installer = getIdeInstaller(IDE_DEFINITIONS.antigravity, platform)!;
|
||||
|
||||
return { installer };
|
||||
}
|
||||
|
||||
it('installs the extension using the alias', async () => {
|
||||
vi.stubEnv('ANTIGRAVITY_CLI_ALIAS', 'agy');
|
||||
const { installer } = setup({});
|
||||
const result = await installer.install();
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
expect(child_process.spawnSync).toHaveBeenCalledWith(
|
||||
'agy',
|
||||
[
|
||||
'--install-extension',
|
||||
'google.gemini-cli-vscode-ide-companion',
|
||||
'--force',
|
||||
],
|
||||
{ stdio: 'pipe', shell: false },
|
||||
);
|
||||
});
|
||||
|
||||
it('returns a failure message if the alias is not set', async () => {
|
||||
vi.stubEnv('ANTIGRAVITY_CLI_ALIAS', '');
|
||||
const { installer } = setup({});
|
||||
const result = await installer.install();
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
expect(result.message).toContain(
|
||||
'ANTIGRAVITY_CLI_ALIAS environment variable not set',
|
||||
);
|
||||
});
|
||||
|
||||
it('returns a failure message if the command is not found', async () => {
|
||||
vi.stubEnv('ANTIGRAVITY_CLI_ALIAS', 'not-a-command');
|
||||
const { installer } = setup({
|
||||
execSync: () => {
|
||||
throw new Error('Command not found');
|
||||
},
|
||||
});
|
||||
const result = await installer.install();
|
||||
|
||||
expect(result.success).toBe(false);
|
||||
expect(result.message).toContain('not-a-command not found');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user