Skip to content

Commit 3e6f065

Browse files
committed
faet(vscode): support multiple workspaces
[ci skip]
1 parent 28567cd commit 3e6f065

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

vscode/extension/tests/lineage.spec.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from 'path'
33
import fs from 'fs-extra'
44
import os from 'os'
55
import { startVSCode, SUSHI_SOURCE_PATH } from './utils'
6+
import { writeFileSync } from 'fs'
67

78
/**
89
* Helper function to launch VS Code and test lineage with given project path config
@@ -141,3 +142,42 @@ test('Lineage panel renders correctly - absolute path project outside of workspa
141142
await fs.remove(tempFolder)
142143
}
143144
})
145+
146+
test('Lineage panel renders correctly - multiworkspace setup', async () => {
147+
const workspaceDir = await fs.mkdtemp(
148+
path.join(os.tmpdir(), 'vscode-test-workspace-'),
149+
)
150+
const projectDir1 = path.join(workspaceDir, 'projects', 'sushi1')
151+
const projectDir2 = path.join(workspaceDir, 'projects', 'sushi2')
152+
await fs.copy(SUSHI_SOURCE_PATH, projectDir1)
153+
await fs.ensureDir(projectDir2)
154+
155+
// Add a .code-workspace file with multiple projects
156+
const workspaceFilePath = path.join(
157+
workspaceDir,
158+
'multi-workspace.code-workspace',
159+
)
160+
writeFileSync(
161+
workspaceFilePath,
162+
JSON.stringify({
163+
folders: [
164+
{
165+
name: 'sushi1',
166+
path: 'projects/sushi1',
167+
},
168+
{
169+
name: 'sushi2',
170+
path: 'projects/sushi2',
171+
},
172+
],
173+
}),
174+
)
175+
176+
try {
177+
const { window, close } = await startVSCode(workspaceFilePath)
178+
await testLineageWithProjectPath(window)
179+
await close()
180+
} finally {
181+
await fs.remove(workspaceDir)
182+
}
183+
})

0 commit comments

Comments
 (0)