mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Allow tests to run multiple times
This commit is contained in:
parent
7548fed110
commit
18408b9090
|
@ -7,7 +7,8 @@ import { Application, Terminal, SettingsEditor, TerminalCommandIdWithValue, Term
|
||||||
import { setTerminalTestSettings } from './terminal-helpers';
|
import { setTerminalTestSettings } from './terminal-helpers';
|
||||||
|
|
||||||
export function setup() {
|
export function setup() {
|
||||||
describe('Terminal Shell Integration', () => {
|
for (let i = 0; i < 100; i++) {
|
||||||
|
describe(`Terminal Shell Integration ${i}`, () => {
|
||||||
let terminal: Terminal;
|
let terminal: Terminal;
|
||||||
let settingsEditor: SettingsEditor;
|
let settingsEditor: SettingsEditor;
|
||||||
let app: Application;
|
let app: Application;
|
||||||
|
@ -20,16 +21,18 @@ export function setup() {
|
||||||
await setTerminalTestSettings(app);
|
await setTerminalTestSettings(app);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
after(async function () {
|
||||||
|
await settingsEditor.clearUserSettings();
|
||||||
|
});
|
||||||
|
|
||||||
afterEach(async function () {
|
afterEach(async function () {
|
||||||
await app.workbench.terminal.runCommand(TerminalCommandId.KillAll);
|
await app.workbench.terminal.runCommand(TerminalCommandId.KillAll);
|
||||||
await settingsEditor.clearUserSettings();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
async function createShellIntegrationProfile() {
|
async function createShellIntegrationProfile() {
|
||||||
await terminal.runCommandWithValue(TerminalCommandIdWithValue.NewWithProfile, process.platform === 'win32' ? 'PowerShell' : 'bash');
|
await terminal.runCommandWithValue(TerminalCommandIdWithValue.NewWithProfile, process.platform === 'win32' ? 'PowerShell' : 'bash');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < 100; i++) {
|
|
||||||
describe(`Shell integration ${i}`, function () {
|
describe(`Shell integration ${i}`, function () {
|
||||||
describe('Decorations', function () {
|
describe('Decorations', function () {
|
||||||
describe('Should show default icons', function () {
|
describe('Should show default icons', function () {
|
||||||
|
@ -39,7 +42,7 @@ export function setup() {
|
||||||
});
|
});
|
||||||
it('Success', async () => {
|
it('Success', async () => {
|
||||||
await createShellIntegrationProfile();
|
await createShellIntegrationProfile();
|
||||||
await terminal.runCommandInTerminal(`ls`);
|
await terminal.runCommandInTerminal(`echo "success"`);
|
||||||
await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 0 });
|
await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 0 });
|
||||||
});
|
});
|
||||||
it('Error', async () => {
|
it('Error', async () => {
|
||||||
|
@ -52,7 +55,7 @@ export function setup() {
|
||||||
it('Should update and show custom icons', async () => {
|
it('Should update and show custom icons', async () => {
|
||||||
await createShellIntegrationProfile();
|
await createShellIntegrationProfile();
|
||||||
await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 });
|
await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 });
|
||||||
await terminal.runCommandInTerminal(`ls`);
|
await terminal.runCommandInTerminal(`echo "success"`);
|
||||||
await terminal.runCommandInTerminal(`fsdkfsjdlfksjdkf`);
|
await terminal.runCommandInTerminal(`fsdkfsjdlfksjdkf`);
|
||||||
await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIcon', '"zap"');
|
await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIcon', '"zap"');
|
||||||
await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconSuccess', '"zap"');
|
await settingsEditor.addUserSetting('terminal.integrated.shellIntegration.decorationIconSuccess', '"zap"');
|
||||||
|
@ -62,6 +65,6 @@ export function setup() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue