Files
SubMiner/src/main/runtime/mpv-jellyfin-defaults-main-deps.test.ts
sudacode a6d85def34 refactor(main): eliminate unsafe runtime cast escapes
Tighten main/runtime dependency contracts to remove non-test `as never` and `as unknown as` usage so type drift surfaces during compile/test checks instead of at runtime.
2026-02-22 13:59:08 -08:00

26 lines
944 B
TypeScript

import assert from 'node:assert/strict';
import test from 'node:test';
import {
createBuildApplyJellyfinMpvDefaultsMainDepsHandler,
createBuildGetDefaultSocketPathMainDepsHandler,
} from './mpv-jellyfin-defaults-main-deps';
test('apply jellyfin mpv defaults main deps builder maps callbacks', () => {
const calls: string[] = [];
const deps = createBuildApplyJellyfinMpvDefaultsMainDepsHandler({
sendMpvCommandRuntime: (_client, command) => calls.push(command.join(':')),
jellyfinLangPref: 'ja,jp',
})();
deps.sendMpvCommandRuntime({ connected: true, send: () => {} }, ['set_property', 'aid', 'auto']);
assert.equal(deps.jellyfinLangPref, 'ja,jp');
assert.deepEqual(calls, ['set_property:aid:auto']);
});
test('get default socket path main deps builder maps platform', () => {
const deps = createBuildGetDefaultSocketPathMainDepsHandler({
platform: 'darwin',
})();
assert.equal(deps.platform, 'darwin');
});