[codex] Make Windows mpv shortcut self-contained (#40)

This commit is contained in:
2026-04-03 21:35:18 -07:00
committed by GitHub
parent d6c72806bb
commit 7514985feb
131 changed files with 3367 additions and 716 deletions

View File

@@ -0,0 +1,31 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { resolveConfig } from '../resolve';
test('resolveConfig trims configured mpv executable path', () => {
const { resolved, warnings } = resolveConfig({
mpv: {
executablePath: ' C:\\Program Files\\mpv\\mpv.exe ',
},
});
assert.equal(resolved.mpv.executablePath, 'C:\\Program Files\\mpv\\mpv.exe');
assert.deepEqual(warnings, []);
});
test('resolveConfig warns for invalid mpv executable path type', () => {
const { resolved, warnings } = resolveConfig({
mpv: {
executablePath: 42 as never,
},
});
assert.equal(resolved.mpv.executablePath, '');
assert.equal(warnings.length, 1);
assert.deepEqual(warnings[0], {
path: 'mpv.executablePath',
value: 42,
fallback: '',
message: 'Expected string.',
});
});