MCPcopy
hub / github.com/microsoft/vscode / assertTasks

Method assertTasks

test/automation/src/task.ts:36–56  ·  view source on GitHub ↗
(filter: string, expected: ITaskConfigurationProperties[], type: 'run' | 'configure')

Source from the content-addressed store, hash-verified

34 }
35
36 async assertTasks(filter: string, expected: ITaskConfigurationProperties[], type: 'run' | 'configure') {
37 // TODO https://github.com/microsoft/vscode/issues/242535
38 // Artificial delay before running non hidden tasks
39 // so that entries from configureTask show up in the quick access.
40 await wait(1000);
41 type === 'run' ? await this.quickaccess.runCommand('workbench.action.tasks.runTask', { keepOpen: true }) : await this.quickaccess.runCommand('workbench.action.tasks.configureTask', { keepOpen: true });
42 if (expected.length === 0) {
43 await this.quickinput.waitForQuickInputElements(e => e.length > 1 && e.every(label => label.trim() !== filter.trim()));
44 }
45 if (expected.length > 0 && !expected[0].hide) {
46 await this.quickinput.waitForQuickInputElements(e => e.length > 1 && e.some(label => label.trim() === filter.trim()));
47 // select the expected task
48 await this.quickinput.selectQuickInputElement(0, true);
49 // Continue without scanning the output
50 await this.quickinput.selectQuickInputElement(0);
51 if (expected[0].icon) {
52 await this.terminal.assertSingleTab({ color: expected[0].icon.color, icon: expected[0].icon.id || 'tools' });
53 }
54 }
55 await this.quickinput.closeQuickInput();
56 }
57
58 async configureTask(properties: ITaskConfigurationProperties) {
59 await this.quickaccess.openFileQuickAccessAndWait('tasks.json', 'tasks.json');

Callers 1

setupFunction · 0.80

Calls 9

waitFunction · 0.90
everyMethod · 0.80
assertSingleTabMethod · 0.80
closeQuickInputMethod · 0.80
runCommandMethod · 0.65
trimMethod · 0.65
someMethod · 0.45

Tested by 1

setupFunction · 0.64