createCaptureOutput
Generated reference page for the createCaptureOutput function export.
- Import:
@kjanat/dreamcli/testkit - Export kind: function
- Declared in:
src/core/output/index.ts - Source link:
packages/dreamcli/src/core/output/index.ts:639
Signatures
ts
function createCaptureOutput(options?: Omit<OutputOptions, "stdout" | "stderr">): [out: Out, captured: CapturedOutput];| Parameter | Type | Description |
|---|---|---|
options | Omit<OutputOptions, "stdout" | "stderr"> | undefined | Optional OutputOptions (minus stdout/stderr,which are wired to the capture buffers automatically). |
Members
Members
createCaptureOutput
Create an output channel that captures all output into arrays.
Useful in tests to assert on what a handler wrote without touching real I/O.
ts
(options?: Omit<OutputOptions, "stdout" | "stderr">): [out: Out, captured: CapturedOutput];Examples
ts
const [out, captured] = createCaptureOutput();
out.log('hello');
out.warn('danger');
expect(captured.stdout).toEqual(['hello\n']);
expect(captured.stderr).toEqual(['danger\n']);