Lines Matching refs:assert

28 const assert = require('assert');
68 assert.strictEqual(typeof req, 'object');
76 assert.strictEqual(err.code, 'EINVAL');
77 assert.strictEqual(getSystemErrorName(err.errno), 'EINVAL');
80 assert.throws(() => {
88 assert.ok(result.length > 0);
91 assert.strictEqual(typeof item, 'object');
92 assert.strictEqual(typeof item.ttl, 'number');
93 assert.strictEqual(typeof item.address, 'string');
94 assert.ok(item.ttl >= 0);
95 assert.ok(isIPv4(item.address));
106 assert.ifError(err);
116 assert.ok(result.length > 0);
119 assert.strictEqual(typeof item, 'object');
120 assert.strictEqual(typeof item.ttl, 'number');
121 assert.strictEqual(typeof item.address, 'string');
122 assert.ok(item.ttl >= 0);
123 assert.ok(isIPv6(item.address));
134 assert.ifError(err);
144 assert.ok(result.length > 0);
147 assert.strictEqual(typeof item, 'object');
148 assert.ok(item.exchange);
149 assert.strictEqual(typeof item.exchange, 'string');
150 assert.strictEqual(typeof item.priority, 'number');
157 assert.ifError(err);
169 assert.strictEqual(err.code, 'ENOTFOUND');
173 assert.ok(err instanceof Error);
174 assert.strictEqual(err.code, 'ENOTFOUND');
176 assert.strictEqual(result, undefined);
186 assert.ok(result.length > 0);
189 assert.ok(item);
190 assert.strictEqual(typeof item, 'string');
197 assert.ifError(err);
209 assert.strictEqual(err.code, 'ENOTFOUND');
213 assert.ok(err instanceof Error);
214 assert.strictEqual(err.code, 'ENOTFOUND');
216 assert.strictEqual(result, undefined);
226 assert.ok(result.length > 0);
229 assert.strictEqual(typeof item, 'object');
230 assert.ok(item.name);
231 assert.strictEqual(typeof item.name, 'string');
232 assert.strictEqual(typeof item.port, 'number');
233 assert.strictEqual(typeof item.priority, 'number');
234 assert.strictEqual(typeof item.weight, 'number');
241 assert.ifError(err);
253 assert.strictEqual(err.code, 'ENOTFOUND');
257 assert.ok(err instanceof Error);
258 assert.strictEqual(err.code, 'ENOTFOUND');
260 assert.strictEqual(result, undefined);
270 assert.ok(result.length > 0);
273 assert.ok(item);
274 assert.strictEqual(typeof item, 'string');
281 assert.ifError(err);
293 assert.strictEqual(err.code, 'ENOTFOUND');
297 assert.ok(err instanceof Error);
298 assert.strictEqual(err.code, 'ENOTFOUND');
300 assert.strictEqual(result, undefined);
310 assert.ok(result.length > 0);
313 assert.strictEqual(typeof item, 'object');
314 assert.strictEqual(typeof item.flags, 'string');
315 assert.strictEqual(typeof item.service, 'string');
316 assert.strictEqual(typeof item.regexp, 'string');
317 assert.strictEqual(typeof item.replacement, 'string');
318 assert.strictEqual(typeof item.order, 'number');
319 assert.strictEqual(typeof item.preference, 'number');
326 assert.ifError(err);
338 assert.strictEqual(err.code, 'ENOTFOUND');
342 assert.ok(err instanceof Error);
343 assert.strictEqual(err.code, 'ENOTFOUND');
345 assert.strictEqual(result, undefined);
355 assert.strictEqual(typeof result, 'object');
356 assert.strictEqual(typeof result.nsname, 'string');
357 assert.ok(result.nsname.length > 0);
358 assert.strictEqual(typeof result.hostmaster, 'string');
359 assert.ok(result.hostmaster.length > 0);
360 assert.strictEqual(typeof result.serial, 'number');
361 assert.ok((result.serial > 0) && (result.serial < 4294967295));
362 assert.strictEqual(typeof result.refresh, 'number');
363 assert.ok((result.refresh > 0) && (result.refresh < 2147483647));
364 assert.strictEqual(typeof result.retry, 'number');
365 assert.ok((result.retry > 0) && (result.retry < 2147483647));
366 assert.strictEqual(typeof result.expire, 'number');
367 assert.ok((result.expire > 0) && (result.expire < 2147483647));
368 assert.strictEqual(typeof result.minttl, 'number');
369 assert.ok((result.minttl >= 0) && (result.minttl < 2147483647));
375 assert.ifError(err);
387 assert.strictEqual(err.code, 'ENOTFOUND');
391 assert.ok(err instanceof Error);
392 assert.strictEqual(err.code, 'ENOTFOUND');
394 assert.strictEqual(result, undefined);
404 assert.ok(Array.isArray(result),
406 assert.strictEqual(result.length, 1);
407 assert.strictEqual(typeof result[0].critical, 'number');
408 assert.strictEqual(result[0].critical, 0);
409 assert.strictEqual(result[0].issue, 'pki.goog');
415 assert.ifError(err);
427 assert.strictEqual(err.code, 'ENOTFOUND');
431 assert.ok(err instanceof Error);
432 assert.strictEqual(err.code, 'ENOTFOUND');
434 assert.strictEqual(result, undefined);
444 assert.ok(result.length > 0);
447 assert.ok(item);
448 assert.strictEqual(typeof item, 'string');
455 assert.ifError(err);
467 assert.strictEqual(err.code, 'ENOTFOUND');
471 assert.ok(err instanceof Error);
472 assert.strictEqual(err.code, 'ENOTFOUND');
474 assert.strictEqual(result, undefined);
485 assert.ok(Array.isArray(result[0]));
486 assert.strictEqual(result.length, 1);
487 assert(result[0][0].startsWith('v=spf1'));
493 assert.ifError(err);
505 assert.strictEqual(err.code, 'ENOTFOUND');
509 assert.ok(err instanceof Error);
510 assert.strictEqual(err.code, 'ENOTFOUND');
512 assert.strictEqual(result, undefined);
527 assert.ok(err instanceof Error);
528 assert.strictEqual(err.code, dns.NOTFOUND);
529 assert.strictEqual(err.code, 'ENOTFOUND');
530 assert.doesNotMatch(err.message, /ENOENT/);
531 assert.ok(err.message.includes(addresses.NOT_FOUND));
542 assert.ok(Array.isArray(result));
543 assert.ok(result.length > 0);
544 assert.strictEqual(result[0].address, '127.0.0.1');
545 assert.strictEqual(result[0].family, 4);
554 assert.ifError(err);
555 assert.strictEqual(family, undefined);
568 assert.ok(Array.isArray(ips));
569 assert.ok(ips.length > 0);
570 assert.strictEqual(ips[0].address, '127.0.0.1');
571 assert.strictEqual(ips[0].family, 4);
583 assert.strictEqual(address, '127.0.0.1');
584 assert.strictEqual(family, 4);
592 assert.deepStrictEqual(await dnsPromises.lookup(null, { all: true }), []);
595 assert.ifError(err);
596 assert.ok(Array.isArray(ips));
597 assert.strictEqual(ips.length, 0);
608 assert.ok(Array.isArray(result));
609 assert.ok(result.length > 0);
613 assert.strictEqual(ip.family, 4);
615 assert.strictEqual(ip.family, 6);
617 assert.fail('unexpected IP address');
626 assert.ifError(err);
641 assert(err instanceof Error);
642 assert.strictEqual(err.code, 'ENOTFOUND');
643 assert.match(err.message, /1\.2\.3\.4/);
662 assert(err instanceof Error);
663 assert.strictEqual(err.code, 'ENOTFOUND'); // Silly error code...
664 assert.strictEqual(err.hostname, '203.0.113.0');
665 assert.match(err.message, /203\.0\.113\.0/);
683 assert(err instanceof Error);
684 assert.strictEqual(err.code, 'ENOTFOUND'); // Silly error code...
685 assert.strictEqual(err.hostname, addresses.NOT_FOUND);
686 assert.ok(err.message.includes(addresses.NOT_FOUND));
697 assert(err instanceof Error);
704 assert.strictEqual(err.code, 'ENOTFOUND'); // Silly error code...
708 assert.strictEqual(err.hostname, addresses.NOT_FOUND);
709 assert.ok(err.message.includes(addresses.NOT_FOUND));
728 assert.strictEqual(err, 0);
730 assert.ok(Array.isArray(domains));
731 assert.ok(domains.length >= 1);
732 assert.strictEqual(typeof domains[0], 'string');
738 assert.strictEqual(running, false);
739 assert.strictEqual(completed, expected);
740 assert.ok(getaddrinfoCallbackCalled);