test(core): Add basic expression tests (no-changelog) (#5439)

* test(core): add basic expression tests

* test: fix $if test not working properly
This commit is contained in:
Valya
2023-02-10 09:05:34 +00:00
committed by GitHub
parent 5b1e3a3fd3
commit 287fa9cd06
4 changed files with 725 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { Expression, INodeExecutionData, Workflow } from '../../src';
import { Expression, IDataObject, Workflow } from '../../src';
import * as Helpers from '../Helpers';
export const TEST_TIMEZONE = 'America/New_York';
@@ -21,14 +21,14 @@ export const workflow = new Workflow({
});
export const expression = new Expression(workflow);
export const evaluate = (value: string, values?: INodeExecutionData[]) =>
export const evaluate = (value: string, values?: IDataObject[]) =>
expression.getParameterValue(
value,
null,
0,
0,
'node',
values ?? [],
values?.map((v) => ({ json: v })) ?? [],
'manual',
TEST_TIMEZONE,
{},