Fixed failing tests and action engine props
This commit is contained in:
@@ -11,4 +11,10 @@ describe('Call Node', function () {
|
||||
assert.isEmpty(context.errors)
|
||||
assert.equal(toString(result), 'min(unknownVariable, 3, 3d30)');
|
||||
});
|
||||
it('reduces', async function () {
|
||||
const callNode = parse('min( unknownVariable, 1 + 2, 3d30 )');
|
||||
const { result, context } = await resolve('reduce', callNode, undefined, undefined, inputProviderForTests);
|
||||
assert.isEmpty(context.errors)
|
||||
assert.equal(toString(result), '0');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -173,16 +173,13 @@ const call: CallFactory = {
|
||||
expectedType = argumentsExpected[index];
|
||||
}
|
||||
if (expectedType === 'parseNode') return;
|
||||
if (
|
||||
node.parseType !== expectedType
|
||||
|| (
|
||||
node.parseType === 'constant'
|
||||
&& node.valueType !== expectedType
|
||||
)
|
||||
) failed = true;
|
||||
failed = !(
|
||||
node.parseType === expectedType
|
||||
|| (node.parseType === 'constant' && node.valueType === expectedType)
|
||||
);
|
||||
if (failed && fn === 'reduce') {
|
||||
const typeName = typeof expectedType === 'string' ? expectedType : expectedType.constructor.name;
|
||||
const nodeName = node.parseType;
|
||||
const nodeName = node.parseType === 'constant' ? node.valueType : node.parseType;
|
||||
context.error(`Incorrect arguments to ${callNode.functionName} function` +
|
||||
`expected ${typeName} got ${nodeName}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user