# test.govlab/quality/core/factories/quality.factory.test.ts

> 20 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-quality-core-factories-quality-factory-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/quality/core/factories/quality.factory.test.ts.txt

Listed in [test.govlab/quality/core/factories](https://banes-lab.com/api/source/testing/test.govlab/quality/core/factories.md), after [test.govlab/quality/core/factories/finding.factory.test.ts](https://banes-lab.com/source/testing/test.govlab/quality/core/factories/finding.factory.test.ts.md) and before [test.govlab/quality/core/factories/tool.factory.test.ts](https://banes-lab.com/source/testing/test.govlab/quality/core/factories/tool.factory.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { createQualityRelations } from "@govlab/quality/core/factories/quality.factory.ts";
import { loadQualityData } from "@govlab/quality/core/loaders/quality.loader.ts";

describe("createQualityRelations", () => {
    it("builds a queryable relations facade over the bundled data", () => {
        const relations = createQualityRelations();
        expect(relations.concerns().length).toBeGreaterThan(0);
        expect(relations.rules().length).toBeGreaterThan(0);
        expect(relations.ecosystems()).toContain("javascript");
        expect(relations.concept("cyclomatic-complexity")).not.toBeNull();
    });
});

describe("loadQualityData", () => {
    it("exposes the ontology record arrays", () => {
        const data = loadQualityData();
        expect(data.concerns.length).toBeGreaterThan(0);
        expect(data.rules.length).toBeGreaterThan(0);
        expect(data.tools.length).toBeGreaterThan(0);
    });
});
```
