tty-test-helper

0.1.1 • Public • Published

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

Package Sidebar

Install

npm i tty-test-helper

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • arve0