-
Notifications
You must be signed in to change notification settings - Fork 213
Expand file tree
/
Copy pathvscode.ts
More file actions
63 lines (57 loc) · 1.59 KB
/
Copy pathvscode.ts
File metadata and controls
63 lines (57 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* eslint-disable @typescript-eslint/no-explicit-any */
export const window: { showInformationMessage: (...args: any[]) => any; showErrorMessage: (...args: any[]) => any } = {
showInformationMessage: vi.fn(),
showErrorMessage: vi.fn(),
}
export const env: { openExternal: (...args: any[]) => any } = {
openExternal: vi.fn(),
}
export const Uri = {
parse: vi.fn((uri: string) => ({ toString: () => uri })),
}
export const commands: { executeCommand: (...args: any[]) => any } = {
executeCommand: vi.fn().mockResolvedValue(undefined),
}
export interface ExtensionContext {
secrets: {
get: (key: string) => Promise<string | undefined>
store: (key: string, value: string) => Promise<void>
delete: (key: string) => Promise<void>
onDidChange: (listener: (e: { key: string }) => void) => {
dispose: () => void
}
}
globalState: {
get: <T>(key: string) => T | undefined
update: (key: string, value: any) => Promise<void>
}
subscriptions: any[]
extension?: {
packageJSON?: {
version?: string
publisher?: string
name?: string
}
}
}
// Mock implementation for tests
export const mockExtensionContext: ExtensionContext = {
secrets: {
get: vi.fn().mockResolvedValue(undefined),
store: vi.fn().mockResolvedValue(undefined),
delete: vi.fn().mockResolvedValue(undefined),
onDidChange: vi.fn().mockReturnValue({ dispose: vi.fn() }),
},
globalState: {
get: vi.fn().mockReturnValue(undefined),
update: vi.fn().mockResolvedValue(undefined),
},
subscriptions: [],
extension: {
packageJSON: {
version: "1.0.0",
publisher: "RooVeterinaryInc",
name: "roo-cline",
},
},
}