MCPcopy
hub / github.com/nodejs/undici / compareGetResults

Function compareGetResults

test/cache-interceptor/cache-store-test-utils.js:459–469  ·  view source on GitHub ↗

* @param {import('../../types/cache-interceptor.d.ts').default.GetResult} actual * @param {import('../../types/cache-interceptor.d.ts').default.CacheValue} expected * @param {Buffer[]} expectedBody

(actual, expected, expectedBody)

Source from the content-addressed store, hash-verified

457 * @param {Buffer[]} expectedBody
458*/
459async function compareGetResults (actual, expected, expectedBody) {
460 const actualBody = await readBody(actual)
461 deepStrictEqual(
462 actualBody ? joinBufferArray(actualBody) : undefined,
463 joinBufferArray(expectedBody)
464 )
465
466 for (const key of Object.keys(expected)) {
467 deepStrictEqual(actual[key], expected[key])
468 }
469}
470
471module.exports = {
472 cacheStoreTests,

Callers 2

cacheStoreTestsFunction · 0.85

Calls 3

joinBufferArrayFunction · 0.85
readBodyFunction · 0.70
keysMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…