|
1 | 1 | import { describe, expect, it } from "bun:test"; |
2 | 2 | import * as v from "valibot"; |
3 | | -import { parseJsonRaw, parseJsonWith } from "../shared/parse"; |
| 3 | +import { parseJsonWith } from "../shared/parse"; |
4 | 4 |
|
5 | 5 | describe("parseJsonWith", () => { |
6 | 6 | const NumberSchema = v.object({ |
@@ -70,38 +70,3 @@ describe("parseJsonWith", () => { |
70 | 70 | expect(result).toBeNull(); |
71 | 71 | }); |
72 | 72 | }); |
73 | | - |
74 | | -describe("parseJsonRaw", () => { |
75 | | - it("should parse valid JSON to unknown", () => { |
76 | | - const result = parseJsonRaw('{"key": "value"}'); |
77 | | - expect(result).toEqual({ |
78 | | - key: "value", |
79 | | - }); |
80 | | - }); |
81 | | - |
82 | | - it("should parse JSON arrays", () => { |
83 | | - const result = parseJsonRaw("[1, 2, 3]"); |
84 | | - expect(result).toEqual([ |
85 | | - 1, |
86 | | - 2, |
87 | | - 3, |
88 | | - ]); |
89 | | - }); |
90 | | - |
91 | | - it("should return null for invalid JSON", () => { |
92 | | - const result = parseJsonRaw("not json"); |
93 | | - expect(result).toBeNull(); |
94 | | - }); |
95 | | - |
96 | | - it("should return null for empty string", () => { |
97 | | - const result = parseJsonRaw(""); |
98 | | - expect(result).toBeNull(); |
99 | | - }); |
100 | | - |
101 | | - it("should parse primitive JSON values", () => { |
102 | | - expect(parseJsonRaw("42")).toBe(42); |
103 | | - expect(parseJsonRaw('"hello"')).toBe("hello"); |
104 | | - expect(parseJsonRaw("true")).toBe(true); |
105 | | - expect(parseJsonRaw("null")).toBeNull(); |
106 | | - }); |
107 | | -}); |
0 commit comments