Files
mcp-wms-wiki/node_modules/zod/src/v4/classic/tests/url.test.ts
T
2026-05-20 09:41:27 +02:00

14 lines
402 B
TypeScript

import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
test("type inference", () => {
const schema = z.string().array();
expectTypeOf<z.infer<typeof schema>>().toEqualTypeOf<string[]>();
});
test("url regex", () => {
expect((z.url({ hostname: /^example\.com$/ }).safeParse("http://example.org/").error?.issues[0] as any).pattern).toBe(
"^example\\.com$"
);
});