Files
openclaw/packages/normalization-core/src/boolean-coercion.test.ts
Dallin Romney febc70036f refactor: consolidate exact boolean coercion (#99750)
* refactor: consolidate exact boolean parsing

* test: fix normalization subpath resolution

* fix: resolve normalization boolean subpath
2026-07-03 19:42:06 -07:00

23 lines
653 B
TypeScript

// Normalization Core tests cover boolean coerce behavior.
import { parseBoolean } from "@openclaw/normalization-core/boolean-coercion";
import { describe, expect, it } from "vitest";
describe("normalization-core/boolean-coercion", () => {
it.each([
[true, true],
[false, false],
["true", true],
[" FALSE ", false],
["TrUe", true],
])("parses %j as %s", (value, expected) => {
expect(parseBoolean(value)).toBe(expected);
});
it.each([undefined, null, 0, 1, "", "yes", "no", "on", "off", "1", "0"])(
"rejects unsupported value %j",
(value) => {
expect(parseBoolean(value)).toBeUndefined();
},
);
});