# test.content/core/loaders/link.loader.test.ts

> 15 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-content-core-loaders-link-loader-test-ts
Source text: https://banes-lab.com/source/testing/test.content/core/loaders/link.loader.test.ts.txt

Listed in [test.content/core/loaders](https://banes-lab.com/api/source/testing/test.content/core/loaders.md), after [test.content/core/loaders/leak.output.loader.test.ts](https://banes-lab.com/source/testing/test.content/core/loaders/leak.output.loader.test.ts.md) and before [test.content/core/loaders/panel.loader.test.ts](https://banes-lab.com/source/testing/test.content/core/loaders/panel.loader.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { linkSetOf, linkTarget, readLinkSet } from "@banes-lab/content/core/loaders/link.loader.ts";

describe("linkSetOf", () => {
    it("keys each section's links by the section", () => {
        const set = linkSetOf([{ fingerprint: "f", key: "p#a", links: ["/x"], page: "p" }]);
        expect(set).toStrictEqual({ "p#a": ["/x"] });
    });
});

describe("linkTarget and readLinkSet", () => {
    it("resolves the baseline under the content reports and reads back a shaped set or null", () => {
        expect(linkTarget()).toContain("link-set");
        const held = readLinkSet();
        expect(held === null || typeof held === "object").toBe(true);
    });
});
```
