# test.content/core/loaders/leak.output.loader.test.ts

> 28 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-content-core-loaders-leak-output-loader-test-ts
Source text: https://banes-lab.com/source/testing/test.content/core/loaders/leak.output.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.loader.test.ts](https://banes-lab.com/source/testing/test.content/core/loaders/leak.loader.test.ts.md) and before [test.content/core/loaders/link.loader.test.ts](https://banes-lab.com/source/testing/test.content/core/loaders/link.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 {
    ESCAPED_SEPARATOR,
    PUBLISHED_TEXT_EXTENSIONS,
    VCS_FOLDER,
} from "@banes-lab/content/configuration/constants/leak.constants.ts";
import { ROOT, absolutePath } from "@ssot/paths";
import { describe, expect, it } from "vitest";
import { extname, sep } from "node:path";
import { machinePaths, publishedPaths, readPublished } from "@banes-lab/content/core/loaders/leak.output.loader.ts";

describe("the published output loader", () => {
    it("lists only text files under the published trees, never a checkout's version-control folder", () => {
        const paths = publishedPaths();
        expect(paths.every((path) => PUBLISHED_TEXT_EXTENSIONS.has(extname(path).toLowerCase()))).toBe(true);
        expect(paths.some((path) => path.split(sep).includes(VCS_FOLDER))).toBe(false);
    });

    it("reads a published file with its path relative to the workspace root", () => {
        const [first] = publishedPaths();
        if (first !== undefined) {
            expect(readPublished(first).file.startsWith(ROOT)).toBe(false);
        }
        expect(absolutePath("builds.web").startsWith(ROOT)).toBe(true);
    });

    it("spells the workspace root in its native, forward-slash and escaped forms", () => {
        const forms = machinePaths();
        expect(forms).toContain(ROOT);
        expect(forms.some((form) => form.includes(ESCAPED_SEPARATOR) || !form.includes("\\"))).toBe(true);
    });
});
```
