Skip to content

Commit

Permalink
misc merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Dahan committed Sep 7, 2019
1 parent 49067c0 commit 1cc51e0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
42 changes: 0 additions & 42 deletions test/exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,48 +42,6 @@ test('exit on unmount() with raw mode', async t => {
t.true(output.includes('exited'));
});

test.cb('handles keypresses', t => {
const term = spawn('node', ['./fixtures/run', './handles-keypresses'], {
name: 'xterm',
cols: 100,
cwd: __dirname,
env: process.env
});

let output = '';

term.on('data', data => {
output += data;
});

let isExited = false;

term.on('exit', code => {
isExited = true;

if (code === 0) {
t.true(output.includes('Exited'));
t.pass();
t.end();
return;
}

t.fail();
t.end();
});

setTimeout(() => {
t.false(isExited);
'abcdefghijklmnopqrstuvwxyz'.split('').forEach(key => term.write(key));
}, 100);

setTimeout(() => {
term.kill();
t.fail();
t.end();
}, 5000);
});

test('exit with thrown error', async t => {
const output = await run('exit-with-thrown-error');
t.true(output.includes('errored'));
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/handles-keypresses.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ const app = render(<KeypressTest/>);

(async () => {
await app.waitUntilExit();
console.log('Exited');
console.log('exited');
})();

0 comments on commit 1cc51e0

Please sign in to comment.