mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-27 16:49:51 -07:00
5d8673f299
- `sync --ui` now launches detached; closing standalone Sync window exits app - `--check` uses BatchMode + ConnectTimeout + 15s timeoutMs on all SSH calls - `runSyncLauncher` settles on `exit` (not just `close`) for Electron pipe inheritance - Added `timeoutMs` to `runSyncLauncher`; check-host passes 30s deadline - `handleSyncCliAtEntry` wraps exit deps for testability; fixes Linux AppImage GUI fallthrough - `config-settings-window` gains optional `onClosed` hook - Added preload-syncui bundle to `build:syncui` script
35 lines
870 B
TypeScript
35 lines
870 B
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { handleSyncCliAtEntry } from './sync-cli';
|
|
|
|
test('handleSyncCliAtEntry exits through the process exit dependency', async () => {
|
|
const exits: number[] = [];
|
|
const handled = await handleSyncCliAtEntry(
|
|
['SubMiner', '--sync-cli', 'sync', '--make-temp'],
|
|
{},
|
|
'0.18.0',
|
|
{
|
|
run: async () => 7,
|
|
exit: (code) => {
|
|
exits.push(code);
|
|
},
|
|
},
|
|
);
|
|
|
|
assert.equal(handled, true);
|
|
assert.deepEqual(exits, [7]);
|
|
});
|
|
|
|
test('handleSyncCliAtEntry ignores normal GUI startup', async () => {
|
|
const handled = await handleSyncCliAtEntry(['SubMiner', '--start'], {}, '0.18.0', {
|
|
run: async () => {
|
|
throw new Error('should not run');
|
|
},
|
|
exit: () => {
|
|
throw new Error('should not exit');
|
|
},
|
|
});
|
|
|
|
assert.equal(handled, false);
|
|
});
|