File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/APPS/CronJobs/Kfintech/node_modules/zod/src/v4/classic/tests/nullable.test.ts
Back
import { expect, test } from "vitest"; import * as z from "zod/v4"; test(".nullable()", () => { const nullable = z.string().nullable(); expect(nullable.parse(null)).toBe(null); expect(nullable.parse("asdf")).toBe("asdf"); expect(() => nullable.parse(123)).toThrow(); }); test(".nullable unwrap", () => { const schema = z.string().nullable(); expect(schema).toBeInstanceOf(z.ZodNullable); expect(schema.unwrap()).toBeInstanceOf(z.ZodString); }); test("z.null", () => { const n = z.null(); expect(n.parse(null)).toBe(null); expect(() => n.parse("asdf")).toThrow(); });
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings