MCPcopy Create free account
hub / github.com/bombshell-dev/clack / MockWritable

Class MockWritable

packages/prompts/test/test-utils.ts:3–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import { Readable, Writable } from 'node:stream';
2
3export class MockWritable extends Writable {
4 public buffer: string[] = [];
5 public isTTY = false;
6 public columns = 80;
7 public rows = 20;
8
9 _write(
10 chunk: any,
11 _encoding: BufferEncoding,
12 callback: (error?: Error | null | undefined) => void
13 ): void {
14 this.buffer.push(chunk.toString());
15 callback();
16 }
17}
18
19export class MockReadable extends Readable {
20 protected _buffer: unknown[] | null = [];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected