All files / core/blong-gogo/src destination.fixture.ts

100% Statements 19/19
100% Branches 4/4
100% Functions 4/4
100% Lines 19/19

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201x 1x 2x 2x 2x 2x 2x 2x 2x 3x 3x 2x 2x 2x 2x 2x 2x 2x 2x  
/** A destination module of a test's own: the shape `log.destination.module` expects. */
export default function fixtureWriter(options: Record<string, unknown>) {
    const lines: string[] = [];
    const ended: string[] = [];
    return {
        lines,
        ended,
        tag: options['tag'],
        write(line: string): void {
            lines.push(line);
        },
        close(): void {
            ended.push('close');
        },
        flush(): void {
            ended.push('flush');
        },
    };
}