mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-01 06:22:44 -08:00
refactor: extract additional main runtime dependency builders
This commit is contained in:
25
src/main/runtime/mpv-jellyfin-defaults-main-deps.test.ts
Normal file
25
src/main/runtime/mpv-jellyfin-defaults-main-deps.test.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
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({}, ['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');
|
||||
});
|
||||
Reference in New Issue
Block a user