feat(core): Node hints(warnings) system (#8954)

This commit is contained in:
Michael Kret
2024-05-13 15:46:02 +03:00
committed by GitHub
parent 4d2115c163
commit da6088d0bb
7 changed files with 265 additions and 6 deletions

View File

@@ -1,5 +1,10 @@
import type { IRun, WorkflowTestData } from 'n8n-workflow';
import { ApplicationError, createDeferredPromise, Workflow } from 'n8n-workflow';
import {
ApplicationError,
createDeferredPromise,
NodeExecutionOutput,
Workflow,
} from 'n8n-workflow';
import { WorkflowExecute } from '@/WorkflowExecute';
import * as Helpers from './helpers';
@@ -192,4 +197,16 @@ describe('WorkflowExecute', () => {
});
}
});
describe('WorkflowExecute, NodeExecutionOutput type test', () => {
//TODO Add more tests here when execution hints are added to some node types
const nodeExecutionOutput = new NodeExecutionOutput(
[[{ json: { data: 123 } }]],
[{ message: 'TEXT HINT' }],
);
expect(nodeExecutionOutput).toBeInstanceOf(NodeExecutionOutput);
expect(nodeExecutionOutput[0][0].json.data).toEqual(123);
expect(nodeExecutionOutput.getHints()[0].message).toEqual('TEXT HINT');
});
});