-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.setup.js
More file actions
66 lines (66 loc) · 1.68 KB
/
Copy pathjest.setup.js
File metadata and controls
66 lines (66 loc) · 1.68 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
64
65
66
// Mock VS Code API for testing
jest.mock('vscode', () => ({
window: {
createStatusBarItem: jest.fn(() => ({
show: jest.fn(),
hide: jest.fn(),
command: undefined,
tooltip: undefined,
text: undefined,
})),
visibleTextEditors: [],
createTextEditorDecorationType: jest.fn(opts => ({})),
onDidChangeActiveTextEditor: jest.fn(() => ({ dispose: jest.fn() })),
createTerminal: jest.fn(() => ({
show: jest.fn(),
sendText: jest.fn(),
dispose: jest.fn(),
})),
showInformationMessage: jest.fn(),
showWarningMessage: jest.fn(),
createOutputChannel: jest.fn(() => ({
appendLine: jest.fn(),
show: jest.fn(),
dispose: jest.fn(),
})),
},
workspace: {
workspaceFolders: undefined,
getConfiguration: jest.fn(() => ({
get: jest.fn(key => {
if (key === 'scriptPath') return '';
return undefined;
}),
})),
createFileSystemWatcher: jest.fn(() => ({
onDidChange: jest.fn(() => ({ dispose: jest.fn() })),
onDidCreate: jest.fn(() => ({ dispose: jest.fn() })),
onDidDelete: jest.fn(() => ({ dispose: jest.fn() })),
dispose: jest.fn(),
})),
},
commands: {
registerCommand: jest.fn(() => ({ dispose: jest.fn() })),
executeCommand: jest.fn(),
},
Uri: {
file: jest.fn(p => ({ fsPath: p, path: p })),
parse: jest.fn(uri => ({ fsPath: uri, path: uri })),
},
Range: jest.fn((start, end) => ({ start, end })),
StatusBarAlignment: {
Left: 0,
Right: 1,
},
OverviewRulerLane: {
Left: 1,
Center: 2,
Right: 4,
Full: 7,
},
env: {
clipboard: {
writeText: jest.fn(),
},
},
}), { virtual: true });