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

> 10 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-build-core-formatters-server-formatter-test-ts
Source text: https://banes-lab.com/source/testing/test.build/core/formatters/server.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/section.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/section.formatter.test.ts.md) and before [test.build/core/formatters/site.formatter.test.ts](https://banes-lab.com/source/testing/test.build/core/formatters/site.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 { describe, expect, it } from "vitest";
import { prefixLines } from "@banes-lab/build-scripts/core/formatters/server.formatter.ts";

describe("prefixLines", () => {
    it("prefixes each complete line and carries a partial line into the next chunk", () => {
        const first = prefixLines("site", "", "ready in 3s\nLocal: http");
        expect(first).toStrictEqual({ carry: "Local: http", lines: ["[site] ready in 3s\n"] });
        const second = prefixLines("site", first.carry, "s://localhost:4202\n");
        expect(second).toStrictEqual({ carry: "", lines: ["[site] Local: https://localhost:4202\n"] });
    });
});
```
