This commit is contained in:
Oleg Maslov
2026-09-02 10:14:22 +02:00
parent 0c3e2ead3b
commit b20b138fe4
771 changed files with 161561 additions and 9027 deletions

View File

@@ -5,6 +5,7 @@
import { describe, it, expect, beforeEach, vi } from 'vitest';
import {
extractSkillRequirements,
buildSkillBinLookupInvocation,
checkSkillRequirements,
clearSkillRequirementsCache,
} from '../src/skill-requirements.js';
@@ -98,3 +99,18 @@ describe('checkSkillRequirements', () => {
expect(hasBin).toHaveBeenCalledTimes(2);
});
});
describe('buildSkillBinLookupInvocation', () => {
it('uses a sanitized env and absolute System32 where.exe on win32', () => {
const invocation = buildSkillBinLookupInvocation('vitest', 'win32', {
PATH: 'C:\\Tools',
SystemRoot: 'C:\\Windows',
OPENAI_API_KEY: 'must-not-cross',
});
expect(invocation.command).toBe('C:\\Windows\\System32\\where.exe');
expect(invocation.args).toEqual(['$PATH:vitest']);
expect(invocation.env.PATH).toBe('C:\\Tools');
expect(invocation.env.OPENAI_API_KEY).toBeUndefined();
});
});