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

> 16 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-stats-core-loaders-report-loader-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/stats/core/loaders/report.loader.test.ts.txt

Listed in [test.govlab/stats/core/loaders](https://banes-lab.com/api/source/testing/test.govlab/stats/core/loaders.md), after [test.govlab/stats/core/loaders/registry.loader.test.ts](https://banes-lab.com/source/testing/test.govlab/stats/core/loaders/registry.loader.test.ts.md) and before [test.govlab/stats/core/loaders/stats.fixture.ts](https://banes-lab.com/source/testing/test.govlab/stats/core/loaders/stats.fixture.ts.md).

## Contained in

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

## Source

```typescript
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),
        );
    });
});
```
