mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-11 14:40:52 -07:00
23 lines
647 B
TypeScript
23 lines
647 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { vi } from 'vitest';
|
|
import { RELAUNCH_EXIT_CODE, relaunchApp } from './processUtils.js';
|
|
import * as cleanup from './cleanup.js';
|
|
|
|
describe('processUtils', () => {
|
|
const processExit = vi
|
|
.spyOn(process, 'exit')
|
|
.mockReturnValue(undefined as never);
|
|
const runExitCleanup = vi.spyOn(cleanup, 'runExitCleanup');
|
|
|
|
it('should run cleanup and exit with the relaunch code', async () => {
|
|
await relaunchApp();
|
|
expect(runExitCleanup).toHaveBeenCalledTimes(1);
|
|
expect(processExit).toHaveBeenCalledWith(RELAUNCH_EXIT_CODE);
|
|
});
|
|
});
|