feat: solution for 'Повторный экзамен: Граф с рефлексией и доработкой'
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
const { createNode } = require('../../src/index');
|
||||
|
||||
test('Reflection node returns input unchanged', () => {
|
||||
const node = createNode('Reflection');
|
||||
const input = { a: 1 };
|
||||
const output = node.execute(input);
|
||||
expect(output).toBe(input);
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
const { createNode } = require('../../src/index');
|
||||
|
||||
test('Rewrite node replaces pattern', () => {
|
||||
const node = createNode('Rewrite', { pattern: /foo/g, replacement: 'bar' });
|
||||
const input = 'foo baz foo';
|
||||
const output = node.execute(input);
|
||||
expect(output).toBe('bar baz bar');
|
||||
});
|
||||
Reference in New Issue
Block a user