Add some runInBackground terminal tests

This commit is contained in:
Daniel Imms
2019-05-23 12:38:25 -07:00
parent 9b3544000e
commit 1f6bf9b92c

View File

@@ -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();
});
});
});
});