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

> 17 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-content-core-loaders-payload-loader-test-ts
Source text: https://banes-lab.com/source/testing/test.content/core/loaders/payload.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/panel.loader.test.ts](https://banes-lab.com/source/testing/test.content/core/loaders/panel.loader.test.ts.md) and before [test.content/core/loaders/section.loader.test.ts](https://banes-lab.com/source/testing/test.content/core/loaders/section.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 { payloadFileOf, readPageContent, readPagePayload } from "@banes-lab/content/core/loaders/payload.loader.ts";

describe("payloadFileOf", () => {
    it("resolves the page payload under the build's json folder", () => {
        expect(payloadFileOf("page").split("\\").join("/")).toContain("/json/page.json");
    });
});

describe("readPagePayload", () => {
    it("returns null for a page that was never built", () => {
        expect(readPagePayload("no-such-page")).toBeNull();
    });
});

describe("readPageContent", () => {
    it("returns null for a page that was never built", () => {
        expect(readPageContent("no-such-page")).toBeNull();
    });
});
```
