mirror of
https://github.com/Microsoft/vscode
synced 2024-07-17 11:07:22 +00:00
tests - disable terminal integration tests for web
This commit is contained in:
parent
9e89ada95f
commit
c0eea2a712
|
@ -8,7 +8,7 @@ import * as assert from 'assert';
|
|||
import { join } from 'path';
|
||||
import { commands, workspace, window, Uri, Range, Position, ViewColumn } from 'vscode';
|
||||
|
||||
suite('commands namespace tests', () => {
|
||||
suite('vscode API - commands', () => {
|
||||
|
||||
test('getCommands', function (done) {
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import 'mocha';
|
|||
import * as assert from 'assert';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
suite('Configuration tests', () => {
|
||||
suite('vscode API - configuration', () => {
|
||||
|
||||
test('configurations, language defaults', function () {
|
||||
const defaultLanguageSettings = vscode.workspace.getConfiguration().get('[abcLang]');
|
||||
|
|
|
@ -8,7 +8,7 @@ import { debug, workspace, Disposable, commands, window } from 'vscode';
|
|||
import { disposeAll } from '../utils';
|
||||
import { basename } from 'path';
|
||||
|
||||
suite('Debug', function () {
|
||||
suite('vscode API - debug', function () {
|
||||
|
||||
test('breakpoints', async function () {
|
||||
assert.equal(debug.breakpoints.length, 0);
|
||||
|
|
|
@ -7,7 +7,7 @@ import * as assert from 'assert';
|
|||
import { workspace, window, Position, Range, commands, TextEditor, TextDocument, TextEditorCursorStyle, TextEditorLineNumbersStyle, SnippetString, Selection, Uri } from 'vscode';
|
||||
import { createRandomFile, deleteFile, closeAllEditors } from '../utils';
|
||||
|
||||
suite('editor tests', () => {
|
||||
suite('vscode API - editors', () => {
|
||||
|
||||
teardown(closeAllEditors);
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import * as assert from 'assert';
|
||||
import { env, extensions, ExtensionKind, UIKind, Uri } from 'vscode';
|
||||
|
||||
suite('env-namespace', () => {
|
||||
suite('vscode API - env', () => {
|
||||
|
||||
test('env is set', function () {
|
||||
assert.equal(typeof env.language, 'string');
|
||||
|
|
|
@ -8,7 +8,7 @@ import { join } from 'path';
|
|||
import * as vscode from 'vscode';
|
||||
import { createRandomFile, testFs } from '../utils';
|
||||
|
||||
suite('languages namespace tests', () => {
|
||||
suite('vscode API - languages', () => {
|
||||
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
|
|
|
@ -18,190 +18,188 @@ interface QuickPickExpected {
|
|||
};
|
||||
}
|
||||
|
||||
suite('window namespace tests', function () {
|
||||
suite('vscode API - quick input', function () {
|
||||
|
||||
suite('QuickInput tests', function () {
|
||||
teardown(closeAllEditors);
|
||||
teardown(closeAllEditors);
|
||||
|
||||
test('createQuickPick, select second', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => {};
|
||||
_done(err);
|
||||
};
|
||||
test('createQuickPick, select second', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => { };
|
||||
_done(err);
|
||||
};
|
||||
|
||||
const quickPick = createQuickPick({
|
||||
events: ['active', 'active', 'selection', 'accept', 'hide'],
|
||||
activeItems: [['eins'], ['zwei']],
|
||||
selectionItems: [['zwei']],
|
||||
acceptedItems: {
|
||||
active: [['zwei']],
|
||||
selection: [['zwei']],
|
||||
dispose: [true]
|
||||
},
|
||||
}, (err?: any) => done(err));
|
||||
quickPick.items = ['eins', 'zwei', 'drei'].map(label => ({ label }));
|
||||
quickPick.show();
|
||||
const quickPick = createQuickPick({
|
||||
events: ['active', 'active', 'selection', 'accept', 'hide'],
|
||||
activeItems: [['eins'], ['zwei']],
|
||||
selectionItems: [['zwei']],
|
||||
acceptedItems: {
|
||||
active: [['zwei']],
|
||||
selection: [['zwei']],
|
||||
dispose: [true]
|
||||
},
|
||||
}, (err?: any) => done(err));
|
||||
quickPick.items = ['eins', 'zwei', 'drei'].map(label => ({ label }));
|
||||
quickPick.show();
|
||||
|
||||
(async () => {
|
||||
await commands.executeCommand('workbench.action.quickOpenSelectNext');
|
||||
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
|
||||
})()
|
||||
.catch(err => done(err));
|
||||
});
|
||||
(async () => {
|
||||
await commands.executeCommand('workbench.action.quickOpenSelectNext');
|
||||
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
|
||||
})()
|
||||
.catch(err => done(err));
|
||||
});
|
||||
|
||||
test('createQuickPick, focus second', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => {};
|
||||
_done(err);
|
||||
};
|
||||
test('createQuickPick, focus second', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => { };
|
||||
_done(err);
|
||||
};
|
||||
|
||||
const quickPick = createQuickPick({
|
||||
events: ['active', 'selection', 'accept', 'hide'],
|
||||
activeItems: [['zwei']],
|
||||
selectionItems: [['zwei']],
|
||||
acceptedItems: {
|
||||
active: [['zwei']],
|
||||
selection: [['zwei']],
|
||||
dispose: [true]
|
||||
},
|
||||
}, (err?: any) => done(err));
|
||||
quickPick.items = ['eins', 'zwei', 'drei'].map(label => ({ label }));
|
||||
quickPick.activeItems = [quickPick.items[1]];
|
||||
quickPick.show();
|
||||
const quickPick = createQuickPick({
|
||||
events: ['active', 'selection', 'accept', 'hide'],
|
||||
activeItems: [['zwei']],
|
||||
selectionItems: [['zwei']],
|
||||
acceptedItems: {
|
||||
active: [['zwei']],
|
||||
selection: [['zwei']],
|
||||
dispose: [true]
|
||||
},
|
||||
}, (err?: any) => done(err));
|
||||
quickPick.items = ['eins', 'zwei', 'drei'].map(label => ({ label }));
|
||||
quickPick.activeItems = [quickPick.items[1]];
|
||||
quickPick.show();
|
||||
|
||||
(async () => {
|
||||
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
|
||||
})()
|
||||
.catch(err => done(err));
|
||||
});
|
||||
(async () => {
|
||||
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
|
||||
})()
|
||||
.catch(err => done(err));
|
||||
});
|
||||
|
||||
test('createQuickPick, select first and second', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => {};
|
||||
_done(err);
|
||||
};
|
||||
test('createQuickPick, select first and second', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => { };
|
||||
_done(err);
|
||||
};
|
||||
|
||||
const quickPick = createQuickPick({
|
||||
events: ['active', 'selection', 'active', 'selection', 'accept', 'hide'],
|
||||
activeItems: [['eins'], ['zwei']],
|
||||
selectionItems: [['eins'], ['eins', 'zwei']],
|
||||
acceptedItems: {
|
||||
active: [['zwei']],
|
||||
selection: [['eins', 'zwei']],
|
||||
dispose: [true]
|
||||
},
|
||||
}, (err?: any) => done(err));
|
||||
quickPick.canSelectMany = true;
|
||||
quickPick.items = ['eins', 'zwei', 'drei'].map(label => ({ label }));
|
||||
quickPick.show();
|
||||
const quickPick = createQuickPick({
|
||||
events: ['active', 'selection', 'active', 'selection', 'accept', 'hide'],
|
||||
activeItems: [['eins'], ['zwei']],
|
||||
selectionItems: [['eins'], ['eins', 'zwei']],
|
||||
acceptedItems: {
|
||||
active: [['zwei']],
|
||||
selection: [['eins', 'zwei']],
|
||||
dispose: [true]
|
||||
},
|
||||
}, (err?: any) => done(err));
|
||||
quickPick.canSelectMany = true;
|
||||
quickPick.items = ['eins', 'zwei', 'drei'].map(label => ({ label }));
|
||||
quickPick.show();
|
||||
|
||||
(async () => {
|
||||
await commands.executeCommand('workbench.action.quickOpenSelectNext');
|
||||
await commands.executeCommand('workbench.action.quickPickManyToggle');
|
||||
await commands.executeCommand('workbench.action.quickOpenSelectNext');
|
||||
await commands.executeCommand('workbench.action.quickPickManyToggle');
|
||||
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
|
||||
})()
|
||||
.catch(err => done(err));
|
||||
});
|
||||
(async () => {
|
||||
await commands.executeCommand('workbench.action.quickOpenSelectNext');
|
||||
await commands.executeCommand('workbench.action.quickPickManyToggle');
|
||||
await commands.executeCommand('workbench.action.quickOpenSelectNext');
|
||||
await commands.executeCommand('workbench.action.quickPickManyToggle');
|
||||
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
|
||||
})()
|
||||
.catch(err => done(err));
|
||||
});
|
||||
|
||||
test('createQuickPick, selection events', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => {};
|
||||
_done(err);
|
||||
};
|
||||
test('createQuickPick, selection events', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => { };
|
||||
_done(err);
|
||||
};
|
||||
|
||||
const quickPick = createQuickPick({
|
||||
events: ['active', 'selection', 'accept', 'selection', 'accept', 'hide'],
|
||||
activeItems: [['eins']],
|
||||
selectionItems: [['zwei'], ['drei']],
|
||||
acceptedItems: {
|
||||
active: [['eins'], ['eins']],
|
||||
selection: [['zwei'], ['drei']],
|
||||
dispose: [false, true]
|
||||
},
|
||||
}, (err?: any) => done(err));
|
||||
quickPick.items = ['eins', 'zwei', 'drei'].map(label => ({ label }));
|
||||
quickPick.show();
|
||||
const quickPick = createQuickPick({
|
||||
events: ['active', 'selection', 'accept', 'selection', 'accept', 'hide'],
|
||||
activeItems: [['eins']],
|
||||
selectionItems: [['zwei'], ['drei']],
|
||||
acceptedItems: {
|
||||
active: [['eins'], ['eins']],
|
||||
selection: [['zwei'], ['drei']],
|
||||
dispose: [false, true]
|
||||
},
|
||||
}, (err?: any) => done(err));
|
||||
quickPick.items = ['eins', 'zwei', 'drei'].map(label => ({ label }));
|
||||
quickPick.show();
|
||||
|
||||
quickPick.selectedItems = [quickPick.items[1]];
|
||||
setTimeout(() => {
|
||||
quickPick.selectedItems = [quickPick.items[2]];
|
||||
}, 0);
|
||||
});
|
||||
quickPick.selectedItems = [quickPick.items[1]];
|
||||
setTimeout(() => {
|
||||
quickPick.selectedItems = [quickPick.items[2]];
|
||||
}, 0);
|
||||
});
|
||||
|
||||
test('createQuickPick, continue after first accept', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => {};
|
||||
_done(err);
|
||||
};
|
||||
test('createQuickPick, continue after first accept', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => { };
|
||||
_done(err);
|
||||
};
|
||||
|
||||
const quickPick = createQuickPick({
|
||||
events: ['active', 'selection', 'accept', 'active', 'selection', 'active', 'selection', 'accept', 'hide'],
|
||||
activeItems: [['eins'], [], ['drei']],
|
||||
selectionItems: [['eins'], [], ['drei']],
|
||||
acceptedItems: {
|
||||
active: [['eins'], ['drei']],
|
||||
selection: [['eins'], ['drei']],
|
||||
dispose: [false, true]
|
||||
},
|
||||
}, (err?: any) => done(err));
|
||||
quickPick.items = ['eins', 'zwei'].map(label => ({ label }));
|
||||
quickPick.show();
|
||||
const quickPick = createQuickPick({
|
||||
events: ['active', 'selection', 'accept', 'active', 'selection', 'active', 'selection', 'accept', 'hide'],
|
||||
activeItems: [['eins'], [], ['drei']],
|
||||
selectionItems: [['eins'], [], ['drei']],
|
||||
acceptedItems: {
|
||||
active: [['eins'], ['drei']],
|
||||
selection: [['eins'], ['drei']],
|
||||
dispose: [false, true]
|
||||
},
|
||||
}, (err?: any) => done(err));
|
||||
quickPick.items = ['eins', 'zwei'].map(label => ({ label }));
|
||||
quickPick.show();
|
||||
|
||||
(async () => {
|
||||
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
|
||||
(async () => {
|
||||
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
|
||||
await timeout(async () => {
|
||||
quickPick.items = ['drei', 'vier'].map(label => ({ label }));
|
||||
await timeout(async () => {
|
||||
quickPick.items = ['drei', 'vier'].map(label => ({ label }));
|
||||
await timeout(async () => {
|
||||
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
|
||||
}, 0);
|
||||
await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem');
|
||||
}, 0);
|
||||
})()
|
||||
.catch(err => done(err));
|
||||
}, 0);
|
||||
})()
|
||||
.catch(err => done(err));
|
||||
});
|
||||
|
||||
test('createQuickPick, dispose in onDidHide', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => { };
|
||||
_done(err);
|
||||
};
|
||||
|
||||
let hidden = false;
|
||||
const quickPick = window.createQuickPick();
|
||||
quickPick.onDidHide(() => {
|
||||
if (hidden) {
|
||||
done(new Error('Already hidden'));
|
||||
} else {
|
||||
hidden = true;
|
||||
quickPick.dispose();
|
||||
setTimeout(done, 0);
|
||||
}
|
||||
});
|
||||
quickPick.show();
|
||||
quickPick.hide();
|
||||
});
|
||||
|
||||
test('createQuickPick, dispose in onDidHide', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => {};
|
||||
_done(err);
|
||||
};
|
||||
test('createQuickPick, hide and dispose', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => { };
|
||||
_done(err);
|
||||
};
|
||||
|
||||
let hidden = false;
|
||||
const quickPick = window.createQuickPick();
|
||||
quickPick.onDidHide(() => {
|
||||
if (hidden) {
|
||||
done(new Error('Already hidden'));
|
||||
} else {
|
||||
hidden = true;
|
||||
quickPick.dispose();
|
||||
setTimeout(done, 0);
|
||||
}
|
||||
});
|
||||
quickPick.show();
|
||||
quickPick.hide();
|
||||
});
|
||||
|
||||
test('createQuickPick, hide and dispose', function (_done) {
|
||||
let done = (err?: any) => {
|
||||
done = () => {};
|
||||
_done(err);
|
||||
};
|
||||
|
||||
let hidden = false;
|
||||
const quickPick = window.createQuickPick();
|
||||
quickPick.onDidHide(() => {
|
||||
if (hidden) {
|
||||
done(new Error('Already hidden'));
|
||||
} else {
|
||||
hidden = true;
|
||||
setTimeout(done, 0);
|
||||
}
|
||||
});
|
||||
quickPick.show();
|
||||
quickPick.hide();
|
||||
quickPick.dispose();
|
||||
let hidden = false;
|
||||
const quickPick = window.createQuickPick();
|
||||
quickPick.onDidHide(() => {
|
||||
if (hidden) {
|
||||
done(new Error('Already hidden'));
|
||||
} else {
|
||||
hidden = true;
|
||||
setTimeout(done, 0);
|
||||
}
|
||||
});
|
||||
quickPick.show();
|
||||
quickPick.hide();
|
||||
quickPick.dispose();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -276,4 +274,4 @@ function createQuickPick(expected: QuickPickExpected, done: (err?: any) => void,
|
|||
|
||||
async function timeout<T>(run: () => Promise<T> | T, ms: number): Promise<T> {
|
||||
return new Promise<T>(resolve => setTimeout(() => resolve(run()), ms));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
import { window, Pseudoterminal, EventEmitter, TerminalDimensions, workspace, ConfigurationTarget, Disposable, UIKind, env } from 'vscode';
|
||||
import { doesNotThrow, equal, ok, deepEqual, throws } from 'assert';
|
||||
|
||||
suite('window namespace tests', () => {
|
||||
// TODO@Daniel flaky tests (https://github.com/microsoft/vscode/issues/92826)
|
||||
((env.uiKind === UIKind.Web) ? suite.skip : suite)('vscode API - terminal', () => {
|
||||
suiteSetup(async () => {
|
||||
// Disable conpty in integration tests because of https://github.com/microsoft/vscode/issues/76548
|
||||
await workspace.getConfiguration('terminal.integrated').update('windowsEnableConpty', false, ConfigurationTarget.Global);
|
||||
|
@ -19,8 +20,8 @@ suite('window namespace tests', () => {
|
|||
disposables.length = 0;
|
||||
});
|
||||
|
||||
// TODO@Daniel flaky test (https://github.com/microsoft/vscode/issues/92826)
|
||||
((env.uiKind === UIKind.Web) ? test.skip : test)('sendText immediately after createTerminal should not throw', (done) => {
|
||||
|
||||
test('sendText immediately after createTerminal should not throw', (done) => {
|
||||
disposables.push(window.onDidOpenTerminal(term => {
|
||||
try {
|
||||
equal(terminal, term);
|
||||
|
@ -34,8 +35,7 @@ suite('window namespace tests', () => {
|
|||
doesNotThrow(terminal.sendText.bind(terminal, 'echo "foo"'));
|
||||
});
|
||||
|
||||
// TODO@Daniel done called multiple times (https://github.com/microsoft/vscode/issues/92826)
|
||||
((env.uiKind === UIKind.Web) ? test.skip : test)('onDidCloseTerminal event fires when terminal is disposed', (done) => {
|
||||
test('onDidCloseTerminal event fires when terminal is disposed', (done) => {
|
||||
disposables.push(window.onDidOpenTerminal(term => {
|
||||
try {
|
||||
equal(terminal, term);
|
||||
|
@ -235,8 +235,7 @@ suite('window namespace tests', () => {
|
|||
});
|
||||
|
||||
suite('window.onDidWriteTerminalData', () => {
|
||||
// TODO@Daniel done called multiple times (https://github.com/microsoft/vscode/issues/92826)
|
||||
((env.uiKind === UIKind.Web) ? test.skip : test)('should listen to all future terminal data events', (done) => {
|
||||
test('should listen to all future terminal data events', (done) => {
|
||||
const openEvents: string[] = [];
|
||||
const dataEvents: { name: string, data: string }[] = [];
|
||||
const closeEvents: string[] = [];
|
||||
|
|
|
@ -7,12 +7,9 @@ import 'mocha';
|
|||
import * as assert from 'assert';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
|
||||
suite('types', () => {
|
||||
suite('vscode API - types', () => {
|
||||
|
||||
test('static properties, es5 compat class', function () {
|
||||
|
||||
|
||||
assert.ok(vscode.ThemeIcon.File instanceof vscode.ThemeIcon);
|
||||
assert.ok(vscode.ThemeIcon.Folder instanceof vscode.ThemeIcon);
|
||||
assert.ok(vscode.CodeActionKind.Empty instanceof vscode.CodeActionKind);
|
||||
|
|
|
@ -14,7 +14,7 @@ const webviewId = 'myWebview';
|
|||
|
||||
const testDocument = join(vscode.workspace.rootPath || '', './bower.json');
|
||||
|
||||
suite('Webview tests', () => {
|
||||
suite('vscode API - webview', () => {
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
|
||||
function _register<T extends vscode.Disposable>(disposable: T) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import { workspace, window, commands, ViewColumn, TextEditorViewColumnChangeEven
|
|||
import { join } from 'path';
|
||||
import { closeAllEditors, pathEquals, createRandomFile } from '../utils';
|
||||
|
||||
suite('window namespace tests', () => {
|
||||
suite('vscode API - window', () => {
|
||||
|
||||
teardown(closeAllEditors);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import * as assert from 'assert';
|
|||
import * as vscode from 'vscode';
|
||||
import { createRandomFile, withLogDisabled } from '../utils';
|
||||
|
||||
suite('workspace-event', () => {
|
||||
suite('vscode API - workspace events', () => {
|
||||
|
||||
const disposables: vscode.Disposable[] = [];
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import * as assert from 'assert';
|
|||
import * as vscode from 'vscode';
|
||||
import { posix } from 'path';
|
||||
|
||||
suite('workspace-fs', () => {
|
||||
suite('vscode API - workspace-fs', () => {
|
||||
|
||||
let root: vscode.Uri;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import * as assert from 'assert';
|
||||
import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomExecution, Pseudoterminal, TaskScope, commands, Task2 } from 'vscode';
|
||||
|
||||
suite('workspace-namespace', () => {
|
||||
suite('vscode API - tasks', () => {
|
||||
|
||||
suite('Tasks', () => {
|
||||
let disposables: Disposable[] = [];
|
||||
|
|
|
@ -9,7 +9,7 @@ import { createRandomFile, deleteFile, closeAllEditors, pathEquals, rndName, dis
|
|||
import { join, posix, basename } from 'path';
|
||||
import * as fs from 'fs';
|
||||
|
||||
suite('workspace-namespace', () => {
|
||||
suite('vscode API - workspace', () => {
|
||||
|
||||
teardown(closeAllEditors);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import * as vscode from 'vscode';
|
|||
import { closeAllEditors, pathEquals } from '../utils';
|
||||
import { join } from 'path';
|
||||
|
||||
suite('workspace-namespace', () => {
|
||||
suite('vscode API - workspace', () => {
|
||||
|
||||
teardown(closeAllEditors);
|
||||
|
||||
|
|
Loading…
Reference in a new issue