Files
2025-09-08 04:48:28 +08:00

19 lines
385 B
TypeScript
Executable File

import { z } from 'zod';
import { parseSchema } from '../../src/parsers/parse-schema';
describe('parseNullable', () => {
test('parseSchema should not add default twice', () => {
expect(
parseSchema(
{
type: 'string',
nullable: true,
default: null,
},
{ path: [], seen: new Map() },
),
).toMatchZod(z.string().nullable().default(null));
});
});