mirror of
https://github.com/stablyai/orca.git
synced 2026-10-18 16:03:17 +00:00
test(runtime): use platform temp paths
This commit is contained in:
@@ -7140,7 +7140,7 @@ describe('OrcaRuntimeService', () => {
|
||||
getRepo: (id: string) => added.find((repo) => repo.id === id) as never
|
||||
}
|
||||
const runtime = new OrcaRuntimeService(createStore as never)
|
||||
const tempRoot = await mkdtemp('/tmp/orca-runtime-create-parent-')
|
||||
const tempRoot = await mkdtemp(join(tmpdir(), 'orca-runtime-create-parent-'))
|
||||
const parentDir = join(tempRoot, 'orca', 'projects')
|
||||
try {
|
||||
const result = await runtime.createRepo(parentDir, 'first-project', 'folder')
|
||||
@@ -7167,7 +7167,7 @@ describe('OrcaRuntimeService', () => {
|
||||
getRepo: (id: string) => added.find((repo) => repo.id === id) as never
|
||||
}
|
||||
const runtime = new OrcaRuntimeService(runtimeStore as never)
|
||||
const parentDir = await mkdtemp('/tmp/orca-runtime-create-root-prep-')
|
||||
const parentDir = await mkdtemp(join(tmpdir(), 'orca-runtime-create-root-prep-'))
|
||||
try {
|
||||
const result = await runtime.createRepo(parentDir, 'runtime-create-root-prep', 'folder')
|
||||
if ('error' in result) {
|
||||
@@ -7181,10 +7181,11 @@ describe('OrcaRuntimeService', () => {
|
||||
})
|
||||
|
||||
it('preserves existing badgeColor on runtime createRepo dedupe', async () => {
|
||||
const repoName = 'runtime-existing-create'
|
||||
const existing = {
|
||||
id: 'runtime-existing-create',
|
||||
path: '/tmp/runtime-existing-create',
|
||||
displayName: 'runtime-existing-create',
|
||||
id: repoName,
|
||||
path: join(tmpdir(), repoName),
|
||||
displayName: repoName,
|
||||
badgeColor: '#14b8a6',
|
||||
addedAt: 1,
|
||||
kind: 'folder' as const
|
||||
@@ -7195,7 +7196,7 @@ describe('OrcaRuntimeService', () => {
|
||||
}
|
||||
const runtime = new OrcaRuntimeService(colorStore as never)
|
||||
|
||||
const result = await runtime.createRepo('/tmp', 'runtime-existing-create', 'folder')
|
||||
const result = await runtime.createRepo(tmpdir(), repoName, 'folder')
|
||||
|
||||
expect(result).toEqual({ repo: existing })
|
||||
expect(result).toHaveProperty('repo.badgeColor', '#14b8a6')
|
||||
|
||||
Reference in New Issue
Block a user