112
113// This function checks if `expected` has all the required fields needed for the checks.
114▶function checkNeededFields(fullPath, expected, error_text, queryName, position) {
115 let fieldsToCheck;
116 if (fullPath.length === 0) {
· · ·
119 "returned",
120 "userQuery",
121▶ "error",
122 ];
123 } else if (fullPath.endsWith("elems") || fullPath.endsWith("returned")) {
· · ·
149 }
150 }
151▶ error_text.push(text);
152 }
153 }
· · ·
154}
155
156▶function valueCheck(fullPath, expected, result, error_text, queryName) {
157 if (Array.isArray(expected) && result instanceof Map) {
158 const expected_set = new Set();
· · ·
159 for (const [key, expected_value] of expected) {
160 expected_set.add(key);
161▶ checkNeededFields(fullPath, expected_value, error_text, queryName, key);
162 if (result.has(key)) {
163 valueCheck(
+ 41 more matches in this file