Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Haze <hazeone@users.noreply.github.com> Co-authored-by: paisley <8197966+su8su@users.noreply.github.com> Co-authored-by: Felix <24791380+vcfgv@users.noreply.github.com>
16 lines
527 B
TypeScript
16 lines
527 B
TypeScript
import { describe, expect, it, vi } from 'vitest';
|
|
import { createSignalQuitHandler } from '@electron/main/signal-quit';
|
|
|
|
describe('signal quit handler', () => {
|
|
it('logs and requests quit when signal is received', () => {
|
|
const logInfo = vi.fn();
|
|
const requestQuit = vi.fn();
|
|
const handler = createSignalQuitHandler({ logInfo, requestQuit });
|
|
|
|
handler('SIGTERM');
|
|
|
|
expect(logInfo).toHaveBeenCalledWith('Received SIGTERM; requesting app quit');
|
|
expect(requestQuit).toHaveBeenCalledTimes(1);
|
|
});
|
|
});
|