New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

logue

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logue

Simplest way to test your interactive command-line app.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

logue

npm npm: total downloads Actions Status: test

The tiny yet powerful test utility for interactive command-line apps.

Install

npm i --save logue
# or
yarn add logue

Example (Jest)

import logue from "logue"

it("test", async () => {
  const app = logue("./my-cli-app.js", ["put", "--args", "here"]) // spawn

  await app.waitFor("continue?") // wait until "continue?" appears in stdout
  expect(app.stdout).toContain("[yes/no]")

  await app.input("yes") // write "yes" to stdin
  await app.end() // wait for the process to be completed
  expect(app.stdout).toContain("Done!")
}

Also, uou can just chain all of methods:

const result = await logue(args).waitFor("continue?").input("y").end();
expect(result.stdout).toContain("Done!");

API

Soon

Contributing

See Contribution guide.

Keywords

cli

FAQs

Package last updated on 03 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts