alepha@docs:~/docs/reference/providers$
cat MemoryOutputProvider.md | pretty
1 min read
Last commit:

#MemoryOutputProvider

#Import

typescript
1import { MemoryOutputProvider } from "alepha/command";

#Overview

Captures command output instead of writing it to stdout.

Substitute it to assert on what a command produced:

ts
1const alepha = Alepha.create()2  .with({ provide: ConsoleOutputProvider, use: MemoryOutputProvider });3 4const output = alepha.inject(MemoryOutputProvider);5expect(output.text).toContain("0.24.0");

Colour is stripped, matching what a caller piping the command would see — the interesting case, and the one worth asserting against. Assertions do not have to know which escape sequences a ConsoleColorProvider happened to emit.