# test.coordination/core/resolvers/entrypoint.resolver.test.ts

> 21 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-coordination-core-resolvers-entrypoint-resolver-test-ts
Source text: https://banes-lab.com/source/testing/test.coordination/core/resolvers/entrypoint.resolver.test.ts.txt

Listed in [test.coordination/core/resolvers](https://banes-lab.com/api/source/testing/test.coordination/core/resolvers.md), after [test.coordination/core/resolvers/dependency.resolver.test.ts](https://banes-lab.com/source/testing/test.coordination/core/resolvers/dependency.resolver.test.ts.md) and before [test.coordination/core/resolvers/gate.resolver.test.ts](https://banes-lab.com/source/testing/test.coordination/core/resolvers/gate.resolver.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, it } from "vitest";
import assert from "node:assert/strict";
import { presenceBackedMutationGuards } from "coordination-surface/tools/core/resolvers/entrypoint.resolver.ts";

const SOURCE = [
    "const quiet = activeSeats(board).length === 0;",
    "const heal = quiet;",
    "runPipeline({",
    "    fix: heal,",
    "});",
].join("\n");

describe("presenceBackedMutationGuards", () => {
    it("follows a mutation guard through the declarations it reads until it reaches a presence reader", () => {
        assert.deepEqual(presenceBackedMutationGuards(SOURCE, ["fix"], ["activeSeats"], 4), [
            { chain: ["heal", "quiet", "activeSeats"], guard: "heal", line: 4, reader: "activeSeats" },
        ]);
    });

    it("stops at the declared depth, and ignores a guard that never reaches a presence reader", () => {
        assert.deepEqual(presenceBackedMutationGuards(SOURCE, ["fix"], ["activeSeats"], 1), []);
        assert.deepEqual(presenceBackedMutationGuards(SOURCE, ["fix"], ["writingSeats"], 4), []);
    });
});
```
