mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-08 03:17:30 -08:00
28 lines
374 B
TypeScript
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();
|
||
|
});
|
||
|
});
|