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

Function testCase

test/client-request.js:633–642  ·  view source on GitHub ↗
(expected, actual)

Source from the content-addressed store, hash-verified

631 after(() => client.destroy())
632
633 const testCase = async (expected, actual) => {
634 const { body } = await client.request({
635 path: '/',
636 method: 'GET',
637 headers: expected
638 })
639
640 const result = await body.json()
641 t.deepStrictEqual(result, { ...result, ...actual })
642 }
643
644 await testCase({ key: [null] }, { key: '' })
645 await testCase({ key: ['test'] }, { key: 'test' })

Callers 1

client-request.jsFile · 0.85

Calls 2

jsonMethod · 0.65
requestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…