mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-10 16:19:24 -07:00
# Conflicts: # package.json # Conflicts: # .github/workflows/release.yml # README.md # package.json # plugin/subminer/lifecycle.lua # scripts/build-yomitan.mjs # src/core/services/overlay-window.ts # src/main.ts # src/main/overlay-shortcuts-runtime.ts # src/main/runtime/overlay-shortcuts-runtime-main-deps.test.ts # src/main/runtime/overlay-shortcuts-runtime-main-deps.ts # src/window-trackers/base-tracker.ts
31 lines
995 B
TypeScript
31 lines
995 B
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { createInitialArgsRuntimeHandler } from './initial-args-runtime-handler';
|
|
|
|
test('initial args runtime handler composes main deps and runs initial command flow', () => {
|
|
const calls: string[] = [];
|
|
const handleInitialArgs = createInitialArgsRuntimeHandler({
|
|
getInitialArgs: () => ({ start: true }) as never,
|
|
isBackgroundMode: () => true,
|
|
shouldEnsureTrayOnStartup: () => false,
|
|
ensureTray: () => calls.push('tray'),
|
|
isTexthookerOnlyMode: () => false,
|
|
hasImmersionTracker: () => true,
|
|
getMpvClient: () => ({
|
|
connected: false,
|
|
connect: () => calls.push('connect'),
|
|
}),
|
|
logInfo: (message) => calls.push(`log:${message}`),
|
|
handleCliCommand: (_args, source) => calls.push(`cli:${source}`),
|
|
});
|
|
|
|
handleInitialArgs();
|
|
|
|
assert.deepEqual(calls, [
|
|
'tray',
|
|
'log:Auto-connecting MPV client for immersion tracking',
|
|
'connect',
|
|
'cli:initial',
|
|
]);
|
|
});
|