deno.land / x / zod@v3.19.1 / __tests__ / complex.test.ts

complex.test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// @ts-ignore TS6133import { expect } from "https://deno.land/x/expect@v0.2.6/mod.ts";const test = Deno.test;
import { crazySchema } from "./crazySchema.ts";// import * as z from "../index";
test("parse", () => { crazySchema.parse({ tuple: ["asdf", 1234, true, null, undefined, "1234"], merged: { k1: "asdf", k2: 12 }, union: ["asdf", 12, "asdf", 12, "asdf", 12], array: [12, 15, 16], // sumTransformer: [12, 15, 16], sumMinLength: [12, 15, 16, 98, 24, 63], intersection: {}, enum: "one", nonstrict: { points: 1234 }, numProm: Promise.resolve(12), lenfun: (x: string) => x.length, });});
zod

Version Info

Tagged at
a year ago