2.0.2 • Published 4 months ago

cli-testing-library v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Build Status version downloads MIT License PRs Welcome Code of Conduct

All Contributors

Watch on GitHub Star on GitHub

Table of Contents

This project is not affiliated with the "Testing Library" ecosystem that this project is clearly inspired from. We're just big fans :)

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:

npm install --save-dev cli-testing-library

Usage

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} = require('cli-testing-library')

test('Is able to make terminal input and view in-progress stdout', async () => {
  const {clear, findByText, queryByText, userEvent} = await render('node', [
    resolve(__dirname, './execute-scripts/stdio-inquirer.js'),
  ])

  const instance = await findByText('First option')

  expect(instance).toBeInTheConsole()

  expect(await findByText('❯ One')).toBeInTheConsole()

  clear()

  userEvent('[ArrowDown]')

  expect(await findByText('❯ Two')).toBeInTheConsole()

  clear()

  userEvent.keyboard('[Enter]')

  expect(await findByText('First option: Two')).toBeInTheConsole()
  expect(await queryByText('First option: Three')).not.toBeInTheConsole()
})

For a API reference documentation, including suggestions on how to use this library, see our documentation introduction with further reading.

While this library does work in Windows, it does not appear to function properly in Windows CI environments, such as GitHub actions. As a result, you may need to either switch CI systems or limit your CI to only run in Linux

If you know how to fix this, please let us know in this tracking issue

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

2.0.2

4 months ago

2.0.1

1 year ago

2.0.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0-alpha.10

2 years ago

1.0.0-alpha.16

2 years ago

1.0.0-alpha.15

2 years ago

1.0.0-alpha.17

2 years ago

1.0.0-alpha.12

2 years ago

1.0.0-alpha.11

2 years ago

1.0.0-alpha.14

2 years ago

1.0.0-alpha.13

2 years ago

1.0.0-alpha.9

2 years ago

1.0.0-alpha.8

2 years ago

1.0.0-alpha.7

2 years ago

1.0.0-alpha.6

2 years ago

1.0.0-alpha.5

2 years ago

1.0.0-alpha.4

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.2

2 years ago

1.0.0

3 years ago

0.1.0

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

1.0.0-alpha.1

3 years ago

0.0.12

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.3

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago