refactor(main): split main.ts into focused runtime modules (#123)

This commit is contained in:
2026-06-12 17:35:46 -07:00
committed by GitHub
parent 94a65416ae
commit 33e767458f
32 changed files with 3582 additions and 2003 deletions
@@ -0,0 +1,34 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { showLogExportErrorDialog, showLogExportSuccessDialog } from './log-export-dialogs';
test('showLogExportSuccessDialog handles dialog rejection', async () => {
const warnings: string[] = [];
await showLogExportSuccessDialog({
zipPath: '/tmp/subminer-logs.zip',
showMessageBox: async () => {
throw new Error('dialog failed');
},
showItemInFolder: () => {
throw new Error('unexpected shell call');
},
logWarn: (message) => warnings.push(message),
});
assert.deepEqual(warnings, ['Failed to show log export success dialog.']);
});
test('showLogExportErrorDialog handles dialog rejection', async () => {
const warnings: string[] = [];
await showLogExportErrorDialog({
message: 'export failed',
showMessageBox: async () => {
throw new Error('dialog failed');
},
logWarn: (message) => warnings.push(message),
});
assert.deepEqual(warnings, ['Failed to show log export error dialog.']);
});