diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts index 50197899110a7..36237a54de7ba 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/terminal.test.ts @@ -357,6 +357,13 @@ import { assertNoRpc, poll } from '../utils'; test('should be defined after selecting all content', async () => { const terminal = window.createTerminal({ name: 'selection test' }); terminal.show(); + // Wait for some terminal data + await new Promise(r => { + const disposable = window.onDidWriteTerminalData(() => { + disposable.dispose(); + r(); + }); + }); await commands.executeCommand('workbench.action.terminal.selectAll'); await poll(() => Promise.resolve(), () => terminal.selection !== undefined, 'selection should be defined'); terminal.dispose(); @@ -364,6 +371,13 @@ import { assertNoRpc, poll } from '../utils'; test('should be undefined after clearing a selection', async () => { const terminal = window.createTerminal({ name: 'selection test' }); terminal.show(); + // Wait for some terminal data + await new Promise(r => { + const disposable = window.onDidWriteTerminalData(() => { + disposable.dispose(); + r(); + }); + }); await commands.executeCommand('workbench.action.terminal.selectAll'); await poll(() => Promise.resolve(), () => terminal.selection !== undefined, 'selection should be defined'); await commands.executeCommand('workbench.action.terminal.clearSelection');