MCPcopy Index your code
hub / github.com/nodejs/node / check

Function check

test/parallel/test-querystring.js:187–209  ·  view source on GitHub ↗
(actual, expected, input)

Source from the content-addressed store, hash-verified

185 '918854443121279438895193');
186
187function check(actual, expected, input) {
188 assert(!(actual instanceof Object));
189 const actualKeys = Object.keys(actual).sort();
190 const expectedKeys = Object.keys(expected).sort();
191 let msg;
192 if (typeof input === 'string') {
193 msg = `Input: ${inspect(input)}\n` +
194 `Actual keys: ${inspect(actualKeys)}\n` +
195 `Expected keys: ${inspect(expectedKeys)}`;
196 }
197 assert.deepStrictEqual(actualKeys, expectedKeys, msg);
198 expectedKeys.forEach((key) => {
199 if (typeof input === 'string') {
200 msg = `Input: ${inspect(input)}\n` +
201 `Key: ${inspect(key)}\n` +
202 `Actual value: ${inspect(actual[key])}\n` +
203 `Expected value: ${inspect(expected[key])}`;
204 } else {
205 msg = undefined;
206 }
207 assert.deepStrictEqual(actual[key], expected[key], msg);
208 });
209}
210
211// Test that the canonical qs is parsed properly.
212qsTestCases.forEach((testCase) => {

Callers 2

Calls 5

sortMethod · 0.80
inspectFunction · 0.70
keysMethod · 0.65
forEachMethod · 0.65
assertFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…