mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat: No expression error when node hasn’t executed (#8448)
Co-authored-by: Giulio Andreini <andreini@netseven.it> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
import type { GenericValue, IDataObject } from '@/Interfaces';
|
||||
import { ExpressionError } from '@/errors/expression.error';
|
||||
|
||||
export interface ExpressionTestBase {
|
||||
type: string;
|
||||
interface ExpressionTestBase {
|
||||
type: 'evaluation' | 'transform';
|
||||
}
|
||||
|
||||
export interface ExpressionTestEvaluation extends ExpressionTestBase {
|
||||
interface ExpressionTestSuccess extends ExpressionTestBase {
|
||||
type: 'evaluation';
|
||||
input: Array<IDataObject | GenericValue>;
|
||||
output: IDataObject | GenericValue;
|
||||
}
|
||||
|
||||
interface ExpressionTestFailure extends ExpressionTestBase {
|
||||
type: 'evaluation';
|
||||
input: Array<IDataObject | GenericValue>;
|
||||
error: ExpressionError;
|
||||
}
|
||||
|
||||
export interface ExpressionTestTransform extends ExpressionTestBase {
|
||||
type: 'transform';
|
||||
// If we don't specify a result we expect it to be the same as the input
|
||||
@@ -17,6 +24,7 @@ export interface ExpressionTestTransform extends ExpressionTestBase {
|
||||
forceTransform?: boolean;
|
||||
}
|
||||
|
||||
export type ExpressionTestEvaluation = ExpressionTestSuccess | ExpressionTestFailure;
|
||||
export type ExpressionTests = ExpressionTestEvaluation | ExpressionTestTransform;
|
||||
|
||||
export interface ExpressionTestFixture {
|
||||
@@ -265,7 +273,11 @@ export const baseFixtures: ExpressionTestFixture[] = [
|
||||
{
|
||||
type: 'evaluation',
|
||||
input: [],
|
||||
output: undefined,
|
||||
error: new ExpressionError('No execution data available', {
|
||||
runIndex: 0,
|
||||
itemIndex: 0,
|
||||
type: 'no_execution_data',
|
||||
}),
|
||||
},
|
||||
{ type: 'transform' },
|
||||
{ type: 'transform', forceTransform: true },
|
||||
|
||||
Reference in New Issue
Block a user