mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-16 15:31:37 +00:00
13 lines
376 B
TypeScript
13 lines
376 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { safeParseJson } from "./json-coercion.js";
|
|
|
|
describe("json-coercion", () => {
|
|
it.each<[string, unknown]>([
|
|
['{"ok":true}', { ok: true }],
|
|
["[1]", [1]],
|
|
['"text"', "text"],
|
|
["null", null],
|
|
["{", undefined],
|
|
])("parses %s", (value, expected) => expect(safeParseJson(value)).toEqual(expected));
|
|
});
|