mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-15 04:18:20 +00:00
test(cli): bind ownership sentinels to each fixture
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
This commit is contained in:
parent
12e04331be
commit
397ac78751
1 changed files with 3 additions and 1 deletions
|
|
@ -172,7 +172,7 @@ describe('installSkill', () => {
|
|||
const rootDir = await mkdtemp(join(tmpdir(), 'skillhub-install-root-'))
|
||||
const skillDir = join(rootDir, 'demo')
|
||||
await mkdir(skillDir, { recursive: true })
|
||||
await writeFile(join(skillDir, 'SKILL.md'), '# Manual')
|
||||
await writeFile(join(skillDir, 'SKILL.md'), '# Global Demo')
|
||||
await writeManagedMetadata(skillDir)
|
||||
const inventoryPath = join(home, '.skillhub', 'inventory.json')
|
||||
await mkdir(join(home, '.skillhub'), { recursive: true })
|
||||
|
|
@ -205,6 +205,7 @@ describe('installSkill', () => {
|
|||
expect(inventory.items[0]).toMatchObject({ namespace: 'global', slug: 'demo' })
|
||||
expect(inventory.items[0].targets).toHaveLength(1)
|
||||
expect(inventory.items[0].targets[0].installDir).toBe(skillDir)
|
||||
expect(await readFile(join(skillDir, 'SKILL.md'), 'utf-8')).toBe('# Global Demo')
|
||||
})
|
||||
|
||||
test('force rejects metadata explicitly owned by another installer', async () => {
|
||||
|
|
@ -213,6 +214,7 @@ describe('installSkill', () => {
|
|||
const rootDir = await mkdtemp(join(tmpdir(), 'skillhub-install-root-'))
|
||||
const skillDir = join(rootDir, 'demo')
|
||||
await mkdir(skillDir, { recursive: true })
|
||||
await writeFile(join(skillDir, 'SKILL.md'), '# Manual')
|
||||
await writeManagedMetadata(skillDir)
|
||||
const metadataPath = join(skillDir, '.skillhub', 'metadata.json')
|
||||
const metadata = JSON.parse(await readFile(metadataPath, 'utf-8'))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue