test: cover remaining nested async skill paths
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -131,6 +131,54 @@ Nested skill.
|
||||
expect(skills[0]?.definition.name).toBe("superpowers/brainstorming")
|
||||
})
|
||||
|
||||
it("preserves nested skill path names for nested {dirName}.md discovery", async () => {
|
||||
// given
|
||||
const nestedSkillDir = join(SKILLS_DIR, "superpowers", "brainstorming")
|
||||
mkdirSync(nestedSkillDir, { recursive: true })
|
||||
writeFileSync(
|
||||
join(nestedSkillDir, "brainstorming.md"),
|
||||
`---
|
||||
name: brainstorming
|
||||
description: Nested brainstorming skill
|
||||
---
|
||||
Nested skill.
|
||||
`
|
||||
)
|
||||
|
||||
// when
|
||||
const { discoverSkillsInDirAsync } = await import("./async-loader")
|
||||
const skills = await discoverSkillsInDirAsync(SKILLS_DIR)
|
||||
|
||||
// then
|
||||
expect(skills).toHaveLength(1)
|
||||
expect(skills[0]?.name).toBe("superpowers/brainstorming")
|
||||
expect(skills[0]?.definition.name).toBe("superpowers/brainstorming")
|
||||
})
|
||||
|
||||
it("preserves nested skill path names for nested direct markdown discovery", async () => {
|
||||
// given
|
||||
const nestedSkillDir = join(SKILLS_DIR, "superpowers")
|
||||
mkdirSync(nestedSkillDir, { recursive: true })
|
||||
writeFileSync(
|
||||
join(nestedSkillDir, "brainstorming.md"),
|
||||
`---
|
||||
name: brainstorming
|
||||
description: Nested brainstorming skill
|
||||
---
|
||||
Nested skill.
|
||||
`
|
||||
)
|
||||
|
||||
// when
|
||||
const { discoverSkillsInDirAsync } = await import("./async-loader")
|
||||
const skills = await discoverSkillsInDirAsync(SKILLS_DIR)
|
||||
|
||||
// then
|
||||
expect(skills).toHaveLength(1)
|
||||
expect(skills[0]?.name).toBe("superpowers/brainstorming")
|
||||
expect(skills[0]?.definition.name).toBe("superpowers/brainstorming")
|
||||
})
|
||||
|
||||
it("skips entries starting with dot", async () => {
|
||||
// given
|
||||
const validContent = `---
|
||||
|
||||
Reference in New Issue
Block a user