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!");
- 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
.
- Fixed bug where state transitions in
CLIEngine
were not possible. - Refactored and moved various classes around.
- Added example states:
MainMenuProgramState
andGreetingProgramState
. These can be used in real projects if desired. - Added documentation to all relevant files.
- First release