Skip to content

Commit e4170cc

Browse files
committed
Make test work on windows (hopfully) and fix interface
1 parent fb43d28 commit e4170cc

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

agent/src/vscode-shim.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,11 @@ const _workspace: typeof vscode.workspace = {
344344
)
345345
)
346346
},
347-
workspaceFolders,
347+
get workspaceFolders() {
348+
// According to the docs, workspaceFolders is `undefined` when no
349+
// workspace has been opened.
350+
return workspaceFolders.length === 0 ? undefined : workspaceFolders
351+
},
348352
getWorkspaceFolder: (uri: vscode.Uri) => {
349353
for (const folder of workspaceFolders) {
350354
if (uriHasPrefix(uri, folder.uri, isWindows())) {

lib/shared/vitest.config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ export default defineProjectWithDefaults(__dirname, {
44
test: {
55
environment: 'jsdom', // needed for DOMPurify
66
setupFiles: ['src/test/testSetup.ts'],
7+
env: {
8+
CODY_SHIM_TESTING: 'true',
9+
},
710
},
811
})

0 commit comments

Comments
 (0)