diff --git a/cli/test/unit/agents/profiles.test.ts b/cli/test/unit/agents/profiles.test.ts index 228ec481..f5be4d2e 100644 --- a/cli/test/unit/agents/profiles.test.ts +++ b/cli/test/unit/agents/profiles.test.ts @@ -53,21 +53,22 @@ describe('agent profiles', () => { test('AstronStudio is detected only when the user .acode skills directory exists', async () => { const home = await mkdtemp(join(tmpdir(), 'skillhub-astron-studio-home-')) const profile = profileMap.get('astron-studio')! - const rootDir = join(home, '.acode', 'skills') + const nativeRootDir = join(home, '.acode', 'skills') + const profileRootDir = nativeRootDir.replace(/\\/g, '/') try { expect(await profile.detectInstalled('/repo', home)).toEqual([]) await mkdir(join(home, '.acode'), { recursive: true }) - await writeFile(rootDir, 'not a directory') + await writeFile(nativeRootDir, 'not a directory') expect(await profile.detectInstalled('/repo', home)).toEqual([]) - await rm(rootDir) - await mkdir(rootDir, { recursive: true }) + await rm(nativeRootDir) + await mkdir(nativeRootDir, { recursive: true }) expect(await profile.detectInstalled('/repo', home)).toEqual([{ agent: 'astron-studio', - rootDir, + rootDir: profileRootDir, scope: 'user', source: 'detected' }]) diff --git a/cli/test/unit/agents/resolver-interactive.test.ts b/cli/test/unit/agents/resolver-interactive.test.ts index 996aea04..13336c50 100644 --- a/cli/test/unit/agents/resolver-interactive.test.ts +++ b/cli/test/unit/agents/resolver-interactive.test.ts @@ -37,10 +37,11 @@ const { resolveInstallTargets } = await import('../../../src/agents/resolver') describe('resolveInstallTargets interactive prompt', () => { test('renders AstronStudio by display name when its directory was detected', async () => { const home = await mkdtemp(join(tmpdir(), 'skillhub-astron-studio-resolver-')) - const rootDir = join(home, '.acode', 'skills') + const nativeRootDir = join(home, '.acode', 'skills') + const profileRootDir = nativeRootDir.replace(/\\/g, '/') try { - await mkdir(rootDir, { recursive: true }) + await mkdir(nativeRootDir, { recursive: true }) await resolveInstallTargets({ cwd: '/repo', home, @@ -50,7 +51,7 @@ describe('resolveInstallTargets interactive prompt', () => { interactive: true }) - expect(renderedChoices[0]?.title).toBe(`AstronStudio (${rootDir})`) + expect(renderedChoices[0]?.title).toBe(`AstronStudio (${profileRootDir})`) } finally { await rm(home, { recursive: true, force: true }) } @@ -75,7 +76,7 @@ describe('resolveInstallTargets interactive prompt', () => { expect(renderedChoices.some(choice => choice.value.agent === 'astron-studio')).toBe(false) expect(targets).toEqual([{ agent: 'generic', - rootDir: join(home, '.agents', 'skills'), + rootDir: `${home}/.agents/skills`, scope: 'user', source: 'fallback' }])