# test.build/core/predicates/asset.predicate.test.ts

> 15 lines of code and 0 definitions.

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

Listed in [test.build/core/predicates](https://banes-lab.com/api/source/testing/test.build/core/predicates.md), before [test.build/core/predicates/exclusion.predicate.test.ts](https://banes-lab.com/source/testing/test.build/core/predicates/exclusion.predicate.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { absolutePath } from "@ssot/paths";
import { isServed } from "@banes-lab/build-scripts/core/predicates/asset.predicate.ts";
import { relative } from "node:path";

describe("isServed", () => {
    it("serves the root files, the page files, the payload route and the generated asset folders, and nothing else", () => {
        const walks = relative(absolutePath("app.public"), absolutePath("app.walks")).split("\\").join("/");
        expect(isServed("robots.txt")).toBe(true);
        expect(isServed("terms.html")).toBe(true);
        expect(isServed("terms.md")).toBe(true);
        expect(isServed("json/terms.json")).toBe(true);
        expect(isServed(`${walks}/walk.a.generated.svg`)).toBe(true);
        expect(isServed("assets/stale.js")).toBe(false);
    });
});
```
