Skip to content

Commit

Permalink
fix: fix other default values test
Browse files Browse the repository at this point in the history
  • Loading branch information
HamishWHC committed Jan 27, 2025
1 parent deabe60 commit a14c702
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/zod/src/converter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ describe('primitive types', () => {
describe('default values', () => {
it('should add the default property', () => {
const schema = z.string().default('test')
expect(zodToJsonSchema(schema)).toEqual({ type: 'string', default: 'test' })
expect(zodToJsonSchema(schema)).toEqual({
anyOf: [
{ const: 'undefined' },
{ type: 'string', default: 'test' },
],
default: 'test',
})
})

it('should be skipped in outputs', () => {
Expand Down

0 comments on commit a14c702

Please sign in to comment.