This project is not affiliated with the "Testing Library" ecosystem that this project is clearly inspired from. We're just big fans :)
This module is distributed via [npm][npm] which is bundled with [node][node] and
should be installed as one of your project's devDependencies:
npm install --save-dev cli-testing-library
This is currently the only section of "usage" documentation. We'll be expanding it as soon as possible
Usage example:
const {resolve} = require('path')
const {render, fireEvent} = require('cli-testing-library')
test('Is able to make terminal input and view in-progress stdout', async () => {
const {cleanup, findByText} = await render('node', [
resolve(__dirname, './execute-scripts/stdio-inquirer.js'),
])
const instance = await findByText('First option')
expect(instance).toBeTruthy()
expect(await findByText('❯ One')).toBeTruthy()
cleanup()
fireEvent.down(instance)
expect(await findByText('❯ Two')).toBeTruthy()
cleanup()
fireEvent.enter(instance)
expect(await findByText('First option: Two')).toBeTruthy()
})Thanks goes to these wonderful people (emoji key):
Corbin Crutchley 💻 📖 🚧 |
This project follows the all-contributors specification. Contributions of any kind welcome!