tty-test-helper

Test interactive console applications


Keywords
test, tty, console, terminal, interactive
License
MIT
Install
npm install tty-test-helper@0.1.1

Documentation

npm version

tty-test-helper

Helper for testing interactive console applications.

import test from 'ava';
import ttyTestHelper from './index.js';

test('ls', async (t) => {
    const app = ttyTestHelper('ls', { args: ['fixtures'], fork: false });

    await app.next();  // waits for next stdout
    t.true(app.stdout.length === 1);
});