/home/techb158/balavpn.abdallabala.com/node_modules/zod/src/v4/classic/tests
NameSizeModeActions
anyunknown.test.ts6390666editdlrm
array.test.ts72840666editdlrm
assignability.test.ts67900666editdlrm
async-parsing.test.ts123110666editdlrm
async-refinements.test.ts18670666editdlrm
base.test.ts1790666editdlrm
bigint.test.ts19560666editdlrm
brand.test.ts22060666editdlrm
catch.test.ts72240666editdlrm
coalesce.test.ts7430666editdlrm
coerce.test.ts77360666editdlrm
continuability.test.ts74780666editdlrm
custom.test.ts12150666editdlrm
date.test.ts9620666editdlrm
datetime.test.ts115110666editdlrm
default.test.ts77170666editdlrm
description.test.ts12940666editdlrm
discriminated-unions.test.ts168100666editdlrm
enum.test.ts84880666editdlrm
error-utils.test.ts125720666editdlrm
error.test.ts195020666editdlrm
file.test.ts24600666editdlrm
firstparty.test.ts29770666editdlrm
function.test.ts62990666editdlrm
generics.test.ts21620666editdlrm
index.test.ts275620666editdlrm
instanceof.test.ts10520666editdlrm
intersection.test.ts47630666editdlrm
json.test.ts33090666editdlrm
lazy.test.ts47560666editdlrm
literal.test.ts24780666editdlrm
map.test.ts48170666editdlrm
nan.test.ts6450666editdlrm
nested-refine.test.ts36230666editdlrm
nonoptional.test.ts24050666editdlrm
nullable.test.ts5910666editdlrm
number.test.ts78270666editdlrm
object.test.ts159990666editdlrm
optional.test.ts41300666editdlrm
partial.test.ts48350666editdlrm
pickomit.test.ts44220666editdlrm
pipe.test.ts18480666editdlrm
prefault.test.ts10070666editdlrm
preprocess.test.ts69590666editdlrm
primitive.test.ts76490666editdlrm
promise.test.ts23150666editdlrm
prototypes.test.ts4980666editdlrm
readonly.test.ts117770666editdlrm
record.test.ts81180666editdlrm
recursive-types.test.ts73350666editdlrm
refine.test.ts147740666editdlrm
registries.test.ts59990666editdlrm
set.test.ts55720666editdlrm
standard-schema.test.ts13690666editdlrm
string-formats.test.ts30680666editdlrm
string.test.ts641240666editdlrm
stringbool.test.ts23330666editdlrm
template-literal.test.ts348360666editdlrm
to-json-schema.test.ts592760666editdlrm
transform.test.ts60000666editdlrm
tuple.test.ts47020666editdlrm
union.test.ts24970666editdlrm
validations.test.ts67360666editdlrm
void.test.ts3060666editdlrm
Edit: /home/techb158/balavpn.abdallabala.com/node_modules/zod/src/v4/classic/tests/validations.test.ts (6736B)
import { expect, test } from "vitest"; import * as z from "zod/v4"; test("string length", async () => { try { await z.string().length(4).parseAsync("asd"); } catch (err) { // ("String must contain exactly 4 character(s)"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_small", "exact": true, "inclusive": true, "message": "Too small: expected string to have >=4 characters", "minimum": 4, "origin": "string", "path": [], }, ] `); } try { await z.string().length(4).parseAsync("asdaa"); } catch (err) { // ("String must contain exactly 4 character(s)"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_big", "exact": true, "inclusive": true, "maximum": 4, "message": "Too big: expected string to have <=4 characters", "origin": "string", "path": [], }, ] `); } }); test("string min/max", async () => { try { await z.string().min(4).parseAsync("asd"); } catch (err) { // ("String must contain at least 4 character(s)"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_small", "inclusive": true, "message": "Too small: expected string to have >=4 characters", "minimum": 4, "origin": "string", "path": [], }, ] `); } }); test("string max", async () => { try { await z.string().max(4).parseAsync("aasdfsdfsd"); } catch (err) { // ("String must contain at most 4 character(s)"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_big", "inclusive": true, "maximum": 4, "message": "Too big: expected string to have <=4 characters", "origin": "string", "path": [], }, ] `); } }); test("number min", async () => { try { await z.number().min(3).parseAsync(2); } catch (err) { // ("Number must be greater than or equal to 3"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_small", "inclusive": true, "message": "Too small: expected number to be >=3", "minimum": 3, "origin": "number", "path": [], }, ] `); } }); test("number gte", async () => { try { await z.number().gte(3).parseAsync(2); } catch (err) { // ("Number must be greater than or equal to 3"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_small", "inclusive": true, "message": "Too small: expected number to be >=3", "minimum": 3, "origin": "number", "path": [], }, ] `); } }); test("number gt", async () => { try { await z.number().gt(3).parseAsync(3); } catch (err) { // ("Number must be greater than or equal to 3"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_small", "inclusive": false, "message": "Too small: expected number to be >3", "minimum": 3, "origin": "number", "path": [], }, ] `); } }); test("number max", async () => { try { await z.number().max(3).parseAsync(4); } catch (err) { // ("Number must be less than or equal to 3"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_big", "inclusive": true, "maximum": 3, "message": "Too big: expected number to be <=3", "origin": "number", "path": [], }, ] `); } }); test("number lte", async () => { try { await z.number().lte(3).parseAsync(4); } catch (err) { // ("Number must be less than or equal to 3"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_big", "inclusive": true, "maximum": 3, "message": "Too big: expected number to be <=3", "origin": "number", "path": [], }, ] `); } }); test("number lt", async () => { try { await z.number().lt(3).parseAsync(3); } catch (err) { // ("Number must be less than or equal to 3"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_big", "inclusive": false, "maximum": 3, "message": "Too big: expected number to be <3", "origin": "number", "path": [], }, ] `); } }); test("number nonnegative", async () => { try { await z.number().nonnegative().parseAsync(-1); } catch (err) { // ("Number must be greater than or equal to 0"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_small", "inclusive": true, "message": "Too small: expected number to be >=0", "minimum": 0, "origin": "number", "path": [], }, ] `); } }); test("number nonpositive", async () => { try { await z.number().nonpositive().parseAsync(1); } catch (err) { // ("Number must be less than or equal to 0"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_big", "inclusive": true, "maximum": 0, "message": "Too big: expected number to be <=0", "origin": "number", "path": [], }, ] `); } }); test("number negative", async () => { try { await z.number().negative().parseAsync(1); } catch (err) { // ("Number must be less than 0"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_big", "inclusive": false, "maximum": 0, "message": "Too big: expected number to be <0", "origin": "number", "path": [], }, ] `); } }); test("number positive", async () => { try { await z.number().positive().parseAsync(-1); } catch (err) { // ("Number must be greater than 0"); expect((err as z.ZodError).issues).toMatchInlineSnapshot(` [ { "code": "too_small", "inclusive": false, "message": "Too small: expected number to be >0", "minimum": 0, "origin": "number", "path": [], }, ] `); } });