mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 06:25:16 -07:00
feat(cli): add macOS run-event notifications (interactive only) (#19056)
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
@@ -56,6 +56,20 @@ vi.mock('./nonInteractiveCli.js', () => ({
|
||||
runNonInteractive: runNonInteractiveSpy,
|
||||
}));
|
||||
|
||||
const terminalNotificationMocks = vi.hoisted(() => ({
|
||||
notifyViaTerminal: vi.fn().mockResolvedValue(true),
|
||||
buildRunEventNotificationContent: vi.fn(() => ({
|
||||
title: 'Session complete',
|
||||
body: 'done',
|
||||
subtitle: 'Run finished',
|
||||
})),
|
||||
}));
|
||||
vi.mock('./utils/terminalNotifications.js', () => ({
|
||||
notifyViaTerminal: terminalNotificationMocks.notifyViaTerminal,
|
||||
buildRunEventNotificationContent:
|
||||
terminalNotificationMocks.buildRunEventNotificationContent,
|
||||
}));
|
||||
|
||||
vi.mock('@google/gemini-cli-core', async (importOriginal) => {
|
||||
const actual =
|
||||
await importOriginal<typeof import('@google/gemini-cli-core')>();
|
||||
@@ -837,6 +851,10 @@ describe('gemini.tsx main function kitty protocol', () => {
|
||||
expect(runNonInteractive).toHaveBeenCalled();
|
||||
const callArgs = vi.mocked(runNonInteractive).mock.calls[0][0];
|
||||
expect(callArgs.input).toBe('stdin-data\n\ntest-question');
|
||||
expect(
|
||||
terminalNotificationMocks.buildRunEventNotificationContent,
|
||||
).not.toHaveBeenCalled();
|
||||
expect(terminalNotificationMocks.notifyViaTerminal).not.toHaveBeenCalled();
|
||||
expect(processExitSpy).toHaveBeenCalledWith(0);
|
||||
processExitSpy.mockRestore();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user