# test.build/core/formatters/markdown.formatter.test.ts

> 19 lines of code and 0 definitions.

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

Listed in [test.build/core/formatters](https://banes-lab.com/api/source/testing/test.build/core/formatters.md), after [test.build/core/formatters/link.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/link.formatter.test.ts.md) and before [test.build/core/formatters/metric.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/metric.formatter.test.ts.md).

## Contained in

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

## Source

`````typescript
import { addressLines, blocks, fenced } from "@banes-lab/build-scripts/core/formatters/markdown.formatter.ts";
import { describe, expect, it } from "vitest";

describe("addressLines and blocks", () => {
    it("drops an empty field and an empty block and joins the rest", () => {
        expect(
            addressLines([
                ["Kind", "x"],
                ["Layer", null],
            ]),
        ).toBe("Kind: x");
        expect(blocks(["# T", null, "", "body"])).toBe("# T\n\nbody\n");
    });
});

describe("fenced", () => {
    it("fences source with a run of backticks longer than any it holds", () => {
        expect(fenced("a ``` b", "md")).toBe("````md\na ``` b\n````");
        expect(fenced("plain", "ts")).toBe("```ts\nplain\n```");
    });
});
`````
