# test.web/core/formatters/link.formatter.test.ts

> 8 lines of code and 0 definitions.

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

Listed in [test.web/core/formatters](https://banes-lab.com/api/source/testing/test.web/core/formatters.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { anchorMarkup } from "@banes-lab/web/core/formatters/link.formatter.ts";

describe("anchorMarkup", () => {
    it("wraps a label in an anchor to its href, and leaves the label plain with no href", () => {
        expect(anchorMarkup("/records/lexicon/cache", "Cache")).toBe('<a href="/records/lexicon/cache">Cache</a>');
        expect(anchorMarkup(null, "Cache")).toBe("Cache");
    });
});
```
