# test.govlab/context/core/matchers/architecture.matcher.test.ts

> 19 lines of code and 0 definitions.

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

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

## Contained in

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

## Source

```typescript
import assert from "node:assert/strict";
import { createArchRelations } from "@govlab/context";
import { matchesPrinciple } from "@govlab/context/core/matchers/architecture.matcher.ts";
import { plantedPrinciple } from "../validators/ontology.fixture.ts";
import { test } from "vitest";

const [principle] = createArchRelations({
    data: [plantedPrinciple("planted-rule", { requires: ["other-rule"], tensions_with: ["care-rule"] })],
}).all();

test("an empty filter matches, and each scalar and list field narrows the match", () => {
    assert.ok(principle);
    assert.equal(matchesPrinciple(principle, {}), true);
    assert.equal(
        matchesPrinciple(principle, { category: "planted", requires: "other-rule", severity: "recommended" }),
        true,
    );
    assert.equal(matchesPrinciple(principle, { tensionsWith: "care-rule", type: "principle" }), true);
    assert.equal(matchesPrinciple(principle, { severity: "mandatory" }), false);
    assert.equal(matchesPrinciple(principle, { enables: "ghost" }), false);
});
```
