mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
Add some runInBackground terminal tests
This commit is contained in:
@@ -737,6 +737,29 @@ suite('window namespace tests', () => {
|
||||
const terminal1 = window.createTerminal({ name: 'test' });
|
||||
terminal1.show();
|
||||
});
|
||||
|
||||
test('runInBackground terminal: onDidWriteData should work', done => {
|
||||
const terminal = window.createTerminal({ name: 'bg', runInBackground: true });
|
||||
let data = '';
|
||||
terminal.onDidWriteData(e => {
|
||||
data += e;
|
||||
if (data.indexOf('foo') !== -1) {
|
||||
terminal.dispose();
|
||||
done();
|
||||
}
|
||||
});
|
||||
terminal.sendText('foo');
|
||||
});
|
||||
|
||||
test('runInBackground terminal: should be available to terminals API', done => {
|
||||
const terminal = window.createTerminal({ name: 'bg', runInBackground: true });
|
||||
window.onDidOpenTerminal(t => {
|
||||
assert.equal(t, terminal);
|
||||
assert.equal(t.name, 'bg');
|
||||
assert.ok(window.terminals.indexOf(terminal) !== -1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user