mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-03 17:07:29 -08:00
26 lines
435 B
TypeScript
26 lines
435 B
TypeScript
|
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',
|
||
|
),
|
||
|
);
|
||
|
});
|
||
|
});
|