mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-18 01:51:20 -07:00
23 lines
588 B
TypeScript
23 lines
588 B
TypeScript
|
|
/**
|
||
|
|
* @license
|
||
|
|
* Copyright 2025 Google LLC
|
||
|
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
|
*/
|
||
|
|
|
||
|
|
import { describe, it, expect, vi } from 'vitest';
|
||
|
|
import { updateEventEmitter } from './updateEventEmitter.js';
|
||
|
|
|
||
|
|
describe('updateEventEmitter', () => {
|
||
|
|
it('should allow registering and emitting events', () => {
|
||
|
|
const callback = vi.fn();
|
||
|
|
const eventName = 'test-event';
|
||
|
|
|
||
|
|
updateEventEmitter.on(eventName, callback);
|
||
|
|
updateEventEmitter.emit(eventName, 'test-data');
|
||
|
|
|
||
|
|
expect(callback).toHaveBeenCalledWith('test-data');
|
||
|
|
|
||
|
|
updateEventEmitter.off(eventName, callback);
|
||
|
|
});
|
||
|
|
});
|