# test.govlab/context/core/analyzers/check.analyzer.test.ts

> 23 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-context-core-analyzers-check-analyzer-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/context/core/analyzers/check.analyzer.test.ts.txt

Listed in [test.govlab/context/core/analyzers](https://banes-lab.com/api/source/testing/test.govlab/context/core/analyzers.md), after [test.govlab/context/core/analyzers/algorithm.analyzer.test.ts](https://banes-lab.com/source/testing/test.govlab/context/core/analyzers/algorithm.analyzer.test.ts.md) and before [test.govlab/context/core/analyzers/template.analyzer.test.ts](https://banes-lab.com/source/testing/test.govlab/context/core/analyzers/template.analyzer.test.ts.md).

## Contained in

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

## Source

```typescript
import { PLANTED_ID, plantedFaces, plantedPrinciple } from "../validators/ontology.fixture.ts";
import { checkGapsOf, uncoveredCollectionsOf } from "@govlab/context/core/analyzers/check.analyzer.ts";
import { ARCH_FACE } from "@govlab/constants";
import assert from "node:assert/strict";
import { test } from "vitest";

test("the check gaps take their resolution from the resolver they are handed", () => {
    const faces = plantedFaces([plantedPrinciple(PLANTED_ID, { enforced_by: ["architecture:any-rule"] })], []);
    const plantedRefs = (resolve: () => boolean): { collection: string; field: string; id: string; ref: string }[] =>
        checkGapsOf(faces, { collections: new Set([ARCH_FACE]), resolve }, [ARCH_FACE], []).unresolvedCheckRefs.filter(
            (entry) => entry.id === PLANTED_ID,
        );
    assert.deepEqual(
        plantedRefs(() => false),
        [{ collection: ARCH_FACE, field: "by", id: PLANTED_ID, ref: "architecture:any-rule" }],
    );
    assert.deepEqual(
        plantedRefs(() => true),
        [],
    );
});

test("a registered collection with no record in the measurement is reported", () => {
    assert.deepEqual(uncoveredCollectionsOf([ARCH_FACE, "future"], []), [ARCH_FACE, "future"]);
});
```
