# test.build/core/converters/payload.converter.test.ts

> 12 lines of code and 0 definitions.

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

Listed in [test.build/core/converters](https://banes-lab.com/api/source/testing/test.build/core/converters.md), after [test.build/core/converters/page.converter.test.ts](https://banes-lab.com/source/testing/test.build/core/converters/page.converter.test.ts.md) and before [test.build/core/converters/reason.catalog.converter.test.ts](https://banes-lab.com/source/testing/test.build/core/converters/reason.catalog.converter.test.ts.md).

## Contained in

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

## Source

```typescript
import { describe, expect, it } from "vitest";
import { textualize } from "@banes-lab/build-scripts/core/converters/payload.converter.ts";

const upper = function upper(value: string): string {
    return value.toUpperCase();
};

describe("textualize", () => {
    it("maps every string in a nested value through the inline converter and leaves other values alone", () => {
        expect(textualize({ a: ["x", { b: "y", n: 1, z: null }] }, upper)).toStrictEqual({
            a: ["X", { b: "Y", n: 1, z: null }],
        });
    });
});
```
