@mudah-cli/testing
v0.9.2
Published
In-process command test runner with captured output, mocked prompts, and JSON assertions.
Downloads
1,599
Maintainers
Readme
@mudah-cli/testing
In-process test helpers for Mudah apps: TestApp for commands, TestTui for full-screen
widgets, plus FS/network/plugin mocks and snapshot assertions. No PTY.
Part of Mudah — an ergonomic, animation-rich CLI framework.
Install
npm install -D @mudah-cli/testingUsage
import { TestApp, TestTui } from '@mudah-cli/testing';
// Commands — real kernel, real providers, captured streams
const app = await TestApp.create({ cwd: appRoot });
const result = await app.dispatch(['welcome', 'Mudah']);
result.exit(0).outContains('Hello, Mudah!');
// Full-screen widgets — mount, drive, snapshot
const tui = TestTui.mount(screen.root, { cols: 80, rows: 24 });
tui.send('down').send('enter');
expect(tui.snapshot()).toContain('prod');Also ships FsMock / mockFs, NetworkMock, MockPluginRegistry, diffSnapshots /
diffTrees, and assertFast for perf-budget assertions.
