mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
feat: Add fork of json-schema-to-zod (no-changelog) (#11228)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { parseNot } from '../../src/parsers/parse-not';
|
||||
|
||||
describe('parseNot', () => {
|
||||
test('parseNot', () => {
|
||||
expect(
|
||||
parseNot(
|
||||
{
|
||||
not: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
{ path: [], seen: new Map() },
|
||||
),
|
||||
).toMatchZod(
|
||||
z
|
||||
.any()
|
||||
.refine(
|
||||
(value) => !z.string().safeParse(value).success,
|
||||
'Invalid input: Should NOT be valid against schema',
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user