test.govlab/stats/core/loaders/report.loader.test.ts

test.govlab/stats/core/loaders/report.loader.test.ts is a file in Codebase Testing. 16 lines of code and 0 definitions.

import { BARE, INPUT } from "./stats.fixture.ts";
import { describe, expect, it } from "vitest";
import { collectVerifyReport } from "@govlab/stats/core/loaders/report.loader.ts";

describe("collectVerifyReport", () => {
    it("reports no recorded run and no pass where the gate wrote no report", () => {
        const stats = collectVerifyReport(BARE);
        expect(stats.available).toBe(false);
        expect(stats.ok).toBe(false);
    });

    it("totals the stages it reads", () => {
        const { stages, totals } = INPUT.verify;
        expect(stages.reduce((sum, stage) => sum + stage.passed + stage.failed, 0)).toBeLessThanOrEqual(
            Math.max(totals.steps, totals.passed + totals.failed),
        );
    });
});