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