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

Function validateResult

test/internet/test-dns.js:89–99  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

87
88test(async function test_resolve4_ttl(done) {
89 function validateResult(result) {
90 assert.ok(result.length > 0);
91
92 for (const item of result) {
93 assert.strictEqual(typeof item, 'object');
94 assert.strictEqual(typeof item.ttl, 'number');
95 assert.strictEqual(typeof item.address, 'string');
96 assert.ok(item.ttl >= 0);
97 assert.ok(isIPv4(item.address));
98 }
99 }
100
101 validateResult(await dnsPromises.resolve4(addresses.INET4_HOST, {
102 ttl: true,

Callers 1

test-dns.jsFile · 0.70

Calls 8

isIPv4Function · 0.85
isIPv6Function · 0.85
inspectMethod · 0.80
everyMethod · 0.80
someMethod · 0.80
forEachMethod · 0.65
okMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…