# test.build/core/converters/reason.index.converter.test.ts

> 13 lines of code and 0 definitions.

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

Listed in [test.build/core/converters](https://banes-lab.com/api/source/testing/test.build/core/converters.md), after [test.build/core/converters/reason.converter.test.ts](https://banes-lab.com/source/testing/test.build/core/converters/reason.converter.test.ts.md) and before [test.build/core/converters/reason.loop.converter.test.ts](https://banes-lab.com/source/testing/test.build/core/converters/reason.loop.converter.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { NODE_KIND } from "@banes-lab/build-scripts/configuration/constants/ontology.constants.ts";
import { createGovlabContext } from "@govlab/context";
import { reasonIndexOf } from "@banes-lab/build-scripts/core/converters/reason.index.converter.ts";

describe("reasonIndexOf", () => {
    it("holds every reasoning record's id under its kind", () => {
        const context = createGovlabContext();
        const index = reasonIndexOf(context);
        expect(index.get(NODE_KIND)?.size).toBe(context.reason.nodes().length);
        const [node] = context.reason.nodes();
        expect(index.get(NODE_KIND)?.has(node?.id ?? "")).toBe(true);
    });
});
```
