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

> 17 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-catalog-loader-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/stats/core/loaders/catalog.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/agent.loader.test.ts](https://banes-lab.com/source/testing/test.govlab/stats/core/loaders/agent.loader.test.ts.md) and before [test.govlab/stats/core/loaders/code.loader.test.ts](https://banes-lab.com/source/testing/test.govlab/stats/core/loaders/code.loader.test.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 { collectQuality } from "@govlab/stats/core/loaders/catalog.loader.ts";

describe("collectQuality", () => {
    it("reads the catalog that the workspace ships", () => {
        expect(INPUT.quality.available).toBe(true);
        expect(INPUT.quality.totalRules).toBeGreaterThan(0);
        expect(INPUT.quality.byTool.size).toBeGreaterThan(0);
        expect(INPUT.quality.concepts).toBeGreaterThan(0);
    });

    it("reports unavailable, and still names its producer, when no catalog is there", () => {
        const stats = collectQuality(BARE);
        expect(stats.available).toBe(false);
        expect(stats.totalRules).toBe(0);
        expect(stats.producer.length).toBeGreaterThan(0);
    });
});
```
