test(3663): add missing-srcDir guard test for stageSkillsForRuntimeAsSkills

RED-6/GREEN-6: non-existent srcCommandsDir returns path unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-05-17 00:13:45 -04:00
parent 82111a9e5e
commit 725dbe2441

View File

@@ -43,6 +43,13 @@ describe('stageSkillsForRuntimeAsSkills', () => {
assert.strictEqual(typeof stageSkillsForRuntimeAsSkills, 'function');
});
test('non-existent srcCommandsDir returns srcCommandsDir unchanged', () => {
const ghost = path.join(os.tmpdir(), 'gsd-rta-no-exist-' + Date.now());
const converter = (content, _skillName) => content;
const result = stageSkillsForRuntimeAsSkills(ghost, { skills: '*' }, converter, 'gsd-');
assert.strictEqual(result, ghost);
});
test('empty prefix produces <stem>/SKILL.md without prefix segment', () => {
const src = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-rta-src-'));
let stagedDir;