# test.govlab/stats/core/converters/taxonomy.converter.test.ts

> 18 lines of code and 0 definitions.

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

Listed in [test.govlab/stats/core/converters](https://banes-lab.com/api/source/testing/test.govlab/stats/core/converters.md), after [test.govlab/stats/core/converters/metric.converter.test.ts](https://banes-lab.com/source/testing/test.govlab/stats/core/converters/metric.converter.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { vocabularyFor } from "@ssot/govlab/shared/manifests/taxonomy.manifest.ts";
import { vocabularyRows } from "@govlab/stats/core/converters/taxonomy.converter.ts";

describe("vocabularyRows", () => {
    it("counts every declared word as unused when no root used it", () => {
        const host = vocabularyFor();
        const rows = vocabularyRows(host, [], {
            declared: 4,
            layerTotals: new Map([["domain", 1]]),
            layers: 2,
            present: 3,
        });
        const byName = new Map(rows.map((row) => [row.name, row]));
        expect(byName.get("concern tags")?.unused).toBe(host.byTag.size);
        expect(byName.get("containers")).toStrictEqual({ declared: 4, name: "containers", unused: 1, used: 3 });
        expect(byName.get("layers")?.used).toBe(1);
    });
});
```
