# test.govlab/docs/core/reporters/base.reporter.test.ts

> 14 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-docs-core-reporters-base-reporter-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/docs/core/reporters/base.reporter.test.ts.txt

Listed in [test.govlab/docs/core/reporters](https://banes-lab.com/api/source/testing/test.govlab/docs/core/reporters.md), before [test.govlab/docs/core/reporters/finding.reporter.test.ts](https://banes-lab.com/source/testing/test.govlab/docs/core/reporters/finding.reporter.test.ts.md).

## Contained in

- [test.govlab/docs/core/reporters](https://banes-lab.com/anatomy/testing/folder-testing-test-govlab-docs-core-reporters.md)

## Source

```typescript
import { afterEach, describe, expect, it, vi } from "vitest";
import { print, printErr } from "@govlab/docs/core/reporters/base.reporter.ts";
import { captureOutput } from "../coordinators/output.fixture.ts";

afterEach(() => {
    vi.restoreAllMocks();
});

describe("print and printErr", () => {
    it("write one line to their stream", () => {
        const output = captureOutput();
        print("hello");
        printErr();
        expect(output).toStrictEqual({ err: ["\n"], out: ["hello\n"] });
    });
});
```
