Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/test/smoke/src/areas/task/task-quick-pick.test.ts
3520 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Application, Task, Terminal, TerminalCommandId } from '../../../../automation/';
7
8
export function setup(options?: { skipSuite: boolean }) {
9
describe('Task Quick Pick', () => {
10
let app: Application;
11
let task: Task;
12
let terminal: Terminal;
13
14
// Acquire automation API
15
before(async function () {
16
app = this.app as Application;
17
task = app.workbench.task;
18
terminal = app.workbench.terminal;
19
});
20
21
afterEach(async () => {
22
// Kill all terminals between every test for a consistent testing environment
23
await terminal.runCommand(TerminalCommandId.KillAll);
24
});
25
26
describe('Tasks: Run Task', () => {
27
const label = "name";
28
const type = "shell";
29
const command = "echo 'test'";
30
it('hide property - true', async () => {
31
await task.configureTask({ type, command, label, hide: true });
32
await task.assertTasks(label, [], 'run');
33
});
34
it('hide property - false', async () => {
35
await task.configureTask({ type, command, label, hide: false });
36
await task.assertTasks(label, [{ label, hide: false }], 'run');
37
});
38
it('hide property - undefined', async () => {
39
await task.configureTask({ type, command, label });
40
await task.assertTasks(label, [{ label }], 'run');
41
});
42
(options?.skipSuite ? it.skip : it.skip)('icon - icon only', async () => {
43
const config = { label, type, command, icon: { id: "lightbulb" } };
44
await task.configureTask(config);
45
await task.assertTasks(label, [config], 'run');
46
});
47
(options?.skipSuite ? it.skip : it.skip)('icon - color only', async () => {
48
const config = { label, type, command, icon: { color: "terminal.ansiRed" } };
49
await task.configureTask(config);
50
await task.assertTasks(label, [{ label, type, command, icon: { color: "Red" } }], 'run');
51
});
52
(options?.skipSuite ? it.skip : it.skip)('icon - icon & color', async () => {
53
const config = { label, type, command, icon: { id: "lightbulb", color: "terminal.ansiRed" } };
54
await task.configureTask(config);
55
await task.assertTasks(label, [{ label, type, command, icon: { id: "lightbulb", color: "Red" } }], 'run');
56
});
57
});
58
//TODO: why won't this command run
59
describe.skip('Tasks: Configure Task', () => {
60
const label = "name";
61
const type = "shell";
62
const command = "echo 'test'";
63
describe('hide', () => {
64
it('true should still show the task', async () => {
65
await task.configureTask({ type, command, label, hide: true });
66
await task.assertTasks(label, [{ label }], 'configure');
67
});
68
});
69
});
70
});
71
}
72
73