# test.govlab/context/core/factories/layer.factory.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-context-core-factories-layer-factory-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/context/core/factories/layer.factory.test.ts.txt

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

## Contained in

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

## Source

```typescript
import { createArchRelations, createGovlabContext, createLexicon } from "@govlab/context";
import assert from "node:assert/strict";
import { createLayerJoin } from "@govlab/context/core/factories/layer.factory.ts";
import { test } from "vitest";

const context = createGovlabContext();
const join = createLayerJoin({ algo: context.algo, arch: createArchRelations(), lex: createLexicon() });

test("the bundled layer join reads every key its data carries and seeds no dead resolution", () => {
    assert.deepEqual(join.unreadKeys(), []);
    assert.deepEqual(join.deadSeeds(), []);
});

test("the layers are the nodes the topology names, and every resolution names two ends", () => {
    const layerIds = new Set(join.layers().map((layer) => layer.id));
    for (const edge of join.topology()) {
        assert.ok(layerIds.has(edge.from) && layerIds.has(edge.to));
    }
    assert.ok(join.resolutions().every((resolution) => resolution.a.length > 0 && resolution.b.length > 0));
});
```
