Rocky_Mountain_Vending/.pnpm-store/v10/files/05/5a9191a7fa9d49a3c5ead9c6df93041316f03c3bf27467ff8c29de1139a7aa57bb1b7a5e2250a5e4f31dfdf3c66727189c19af96be3b6a76c81e4ddb5032a8
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

57 lines
1.3 KiB
Text

import { expect, test } from "vitest";
import * as z from "zod/v4";
test("length checks", async () => {
const schema = z.string();
const result = await schema["~standard"].validate(12);
expect(result).toMatchInlineSnapshot(`
{
"issues": [
{
"code": "invalid_type",
"expected": "string",
"message": "Invalid input: expected string, received number",
"path": [],
},
],
}
`);
});
test("length checks", async () => {
const schema = z.string();
const result = await schema["~standard"].validate("asdf");
expect(result).toMatchInlineSnapshot(`
{
"value": "asdf",
}
`);
});
test("length checks", async () => {
const schema = z.string().refine(async (val) => val.length > 5);
const result = await schema["~standard"].validate(12);
expect(result).toMatchInlineSnapshot(`
{
"issues": [
{
"code": "invalid_type",
"expected": "string",
"message": "Invalid input: expected string, received number",
"path": [],
},
],
}
`);
});
test("length checks", async () => {
const schema = z.string().refine(async (val) => val.length > 5);
const result = await schema["~standard"].validate("234134134");
expect(result).toMatchInlineSnapshot(`
{
"value": "234134134",
}
`);
});