Download packages/cli/src/ui/commands/corgiCommand.test.ts from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/commands/corgiCommand.test.ts
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/ui/commands/corgiCommand.test.ts
-
curl -L -o corgiCommand.test.ts https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/commands/corgiCommand.test.ts
1.02 kB
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import { describe, it, expect, beforeEach, vi } from 'vitest'; | |
| import { corgiCommand } from './corgiCommand.js'; | |
| import { type CommandContext } from './types.js'; | |
| import { createMockCommandContext } from '../../test-utils/mockCommandContext.js'; | |
| describe('corgiCommand', () => { | |
| let mockContext: CommandContext; | |
| beforeEach(() => { | |
| mockContext = createMockCommandContext(); | |
| vi.spyOn(mockContext.ui, 'toggleCorgiMode'); | |
| }); | |
| it('should call the toggleCorgiMode function on the UI context', async () => { | |
| if (!corgiCommand.action) { | |
| throw new Error('The corgi command must have an action.'); | |
| } | |
| await corgiCommand.action(mockContext, ''); | |
| expect(mockContext.ui.toggleCorgiMode).toHaveBeenCalledTimes(1); | |
| }); | |
| it('should have the correct name and description', () => { | |
| expect(corgiCommand.name).toBe('corgi'); | |
| expect(corgiCommand.description).toBe('Toggles corgi mode'); | |
| }); | |
| }); | |