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

test.build/core/converters/payload.converter.test.ts is a file in Codebase Testing. 12 lines of code and 0 definitions.

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 }],
        });
    });
});