You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message: `Variable "$input" got invalid value ${value} at "input[${index}]"; Expected type String. String cannot represent a non string value: ${value}`,
1010
+
locations: [{line: 2,column: 14}],
1011
+
};
1012
+
}
1013
+
1014
+
it('when maxErrors is equal to number of errors',()=>{
1003
1015
constresult=getVariableValues(
1004
1016
schema,
1005
-
operation.variableDefinitions||[],
1006
-
{input: [0,1,2]},
1017
+
variableDefinitions,
1018
+
inputValue,
1019
+
{maxErrors: 3},
1020
+
);
1021
+
1022
+
expect(result).to.deep.equal({
1023
+
errors: [
1024
+
invalidValueError(0,0),
1025
+
invalidValueError(1,1),
1026
+
invalidValueError(2,2),
1027
+
],
1028
+
});
1029
+
});
1030
+
1031
+
it('when maxErrors is less than number of errors',()=>{
1032
+
constresult=getVariableValues(
1033
+
schema,
1034
+
variableDefinitions,
1035
+
inputValue,
1007
1036
{maxErrors: 2},
1008
1037
);
1009
1038
1010
1039
expect(result).to.deep.equal({
1011
1040
errors: [
1012
-
{
1013
-
message:
1014
-
'Variable "$input" got invalid value 0 at "input[0]"; Expected type String. String cannot represent a non string value: 0',
1015
-
locations: [{line: 2,column: 16}],
1016
-
},
1017
-
{
1018
-
message:
1019
-
'Variable "$input" got invalid value 1 at "input[1]"; Expected type String. String cannot represent a non string value: 1',
1020
-
locations: [{line: 2,column: 16}],
1021
-
},
1041
+
invalidValueError(0,0),
1042
+
invalidValueError(1,1),
1022
1043
{
1023
1044
message:
1024
1045
'Too many errors processing variables, error limit reached. Execution aborted.',
0 commit comments