From 808b40d319c311fc4f4663ad7e7ee38c49f6f92a Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sun, 17 May 2026 00:13:56 -0400 Subject: [PATCH] test(3663): add STAGED_DIRS registration test for stageSkillsForRuntimeAsSkills RED-7/GREEN-7: verifies stagedDir is added to STAGED_DIRS after staging. Co-Authored-By: Claude Sonnet 4.6 --- tests/install-profiles-stage.test.cjs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/install-profiles-stage.test.cjs b/tests/install-profiles-stage.test.cjs index 16723e060..b3fbe21eb 100644 --- a/tests/install-profiles-stage.test.cjs +++ b/tests/install-profiles-stage.test.cjs @@ -43,6 +43,21 @@ describe('stageSkillsForRuntimeAsSkills', () => { assert.strictEqual(typeof stageSkillsForRuntimeAsSkills, 'function'); }); + test('registers stagedDir in STAGED_DIRS after staging', () => { + const src = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-rta-src-')); + let stagedDir; + try { + fs.writeFileSync(path.join(src, 'alpha.md'), '# alpha\n'); + cleanupStagedSkills(); + const converter = (content, _skillName) => content; + stagedDir = stageSkillsForRuntimeAsSkills(src, { skills: '*' }, converter, 'gsd-'); + assert.ok(STAGED_DIRS.has(stagedDir), 'stagedDir must be in STAGED_DIRS'); + } finally { + fs.rmSync(src, { recursive: true, force: true }); + if (stagedDir) cleanupStagedSkills(); + } + }); + test('non-existent srcCommandsDir returns srcCommandsDir unchanged', () => { const ghost = path.join(os.tmpdir(), 'gsd-rta-no-exist-' + Date.now()); const converter = (content, _skillName) => content;