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

test.govlab/docs/core/reporters/base.reporter.test.ts is a file in Codebase Testing. 14 lines of code and 0 definitions.

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"] });
    });
});