n8n/packages/@n8n/json-schema-to-zod/test/utils/omit.test.ts

28 lines
374 B
TypeScript

import { omit } from '../../src/utils/omit';
describe('omit', () => {
test('omit', () => {
const input = {
a: true,
b: true,
};
omit(
input,
'b',
// @ts-expect-error
'c',
);
const output = omit(input, 'b');
// @ts-expect-error
output.b;
expect(output.a).toBe(true);
// @ts-expect-error
expect(output.b).toBeUndefined();
});
});