test(3663): add Set filtering test for stageSkillsForRuntimeAsSkills
RED-3/GREEN-3: filter already present from GREEN-2 implementation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,23 @@ describe('stageSkillsForRuntimeAsSkills', () => {
|
|||||||
assert.strictEqual(typeof stageSkillsForRuntimeAsSkills, 'function');
|
assert.strictEqual(typeof stageSkillsForRuntimeAsSkills, 'function');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('skills Set filters: only matching stems land in stagedDir', () => {
|
||||||
|
const src = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-rta-src-'));
|
||||||
|
let stagedDir;
|
||||||
|
try {
|
||||||
|
for (const name of ['alpha', 'beta', 'phase']) {
|
||||||
|
fs.writeFileSync(path.join(src, `${name}.md`), `# ${name}\n`);
|
||||||
|
}
|
||||||
|
const converter = (content, _skillName) => content;
|
||||||
|
stagedDir = stageSkillsForRuntimeAsSkills(src, { skills: new Set(['phase']) }, converter, 'gsd-');
|
||||||
|
const entries = fs.readdirSync(stagedDir).sort();
|
||||||
|
assert.deepStrictEqual(entries, ['gsd-phase']);
|
||||||
|
} finally {
|
||||||
|
fs.rmSync(src, { recursive: true, force: true });
|
||||||
|
if (stagedDir) cleanupStagedSkills();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test('skills === "*" stages all md files as <prefix><stem>/SKILL.md', () => {
|
test('skills === "*" stages all md files as <prefix><stem>/SKILL.md', () => {
|
||||||
const src = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-rta-src-'));
|
const src = fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-rta-src-'));
|
||||||
let stagedDir;
|
let stagedDir;
|
||||||
|
|||||||
Reference in New Issue
Block a user