testable-cli
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

testable-cli

An easy way to create testable CLIs, based on the principle of testing based on how the user would interact with the system.

import {ConsoleLogOutputHandler, MainMenuProgramState, CLIEngine} from "testable-cli";

const output = new ConsoleLogOutputHandler();
const initialState = new MainMenuProgramState(output);
const engine = new CLIEngine(initialState);

engine.sendMessage("Hello, world!");

Changelog

1.2.0

  • Changed project from being of type module to being a regular NPM project with CommonJS.
  • Added changelog to README.md.
  • Added basic example of how to use the package in README.md.

1.1.0

  • Fixed bug where state transitions in CLIEngine were not possible.
  • Refactored and moved various classes around.
  • Added example states: MainMenuProgramState and GreetingProgramState. These can be used in real projects if desired.
  • Added documentation to all relevant files.

1.0.0

  • First release

Package Sidebar

Install

npm i testable-cli

Weekly Downloads

0

Version

1.2.0

License

MIT

Unpacked Size

18.7 kB

Total Files

19

Last publish

Collaborators

  • bigbeno37