Add integration test

This commit is contained in:
Daniel Imms
2017-03-24 14:56:49 -07:00
parent 0358f180bd
commit 1fa2d91f8c

View File

@@ -354,4 +354,19 @@ suite('window namespace tests', () => {
test('terminal, name should set terminal.name', () => {
assert.equal(window.createTerminal('foo').name, 'foo');
});
test('terminal, listening to onData should report data from the pty process', done => {
const terminal = window.createTerminal();
let fromPty = '';
let isFinished = false;
(<any>terminal).onData(data => {
// The text could be split over multiple callbacks
fromPty += data;
if (!isFinished && fromPty.indexOf('test') >= 0) {
isFinished = true;
done();
}
});
terminal.sendText('test');
});
});