提交 1a1b76f0 编写于 作者: A Alex Ross

Check for undefined specifically in task execution test

Part of #100361
上级 2b2f5b2f
...@@ -144,13 +144,17 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx ...@@ -144,13 +144,17 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx
let taskExecution: TaskExecution | undefined; let taskExecution: TaskExecution | undefined;
disposables.push(tasks.onDidStartTaskProcess(e => { disposables.push(tasks.onDidStartTaskProcess(e => {
if (e.execution !== taskExecution) { if (taskExecution === undefined) {
reject('taskExecution is still undefined when process started.');
} else if (e.execution !== taskExecution) {
reject('Unexpected task execution value in start process.'); reject('Unexpected task execution value in start process.');
} }
})); }));
disposables.push(tasks.onDidEndTaskProcess(e => { disposables.push(tasks.onDidEndTaskProcess(e => {
if (e.execution === taskExecution) { if (taskExecution === undefined) {
reject('taskExecution is still undefined when process ended.');
} else if (e.execution === taskExecution) {
resolve(); resolve();
} else { } else {
reject('Unexpected task execution value in end process.'); reject('Unexpected task execution value in end process.');
...@@ -167,7 +171,9 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx ...@@ -167,7 +171,9 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx
let taskExecution: TaskExecution | undefined; let taskExecution: TaskExecution | undefined;
disposables.push(tasks.onDidStartTaskProcess(e => { disposables.push(tasks.onDidStartTaskProcess(e => {
if (e.execution === taskExecution) { if (taskExecution === undefined) {
reject('taskExecution is still undefined when process started.');
} else if (e.execution === taskExecution) {
resolve(); resolve();
} else { } else {
reject('Unexpected task execution value in start process.'); reject('Unexpected task execution value in start process.');
...@@ -175,7 +181,9 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx ...@@ -175,7 +181,9 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx
})); }));
disposables.push(tasks.onDidEndTaskProcess(e => { disposables.push(tasks.onDidEndTaskProcess(e => {
if (e.execution !== taskExecution) { if (taskExecution === undefined) {
reject('taskExecution is still undefined when process ended.');
} else if (e.execution !== taskExecution) {
reject('Unexpected task execution value in end process.'); reject('Unexpected task execution value in end process.');
} }
})); }));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册