GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: add dns.onlookupall() to increase coverage · nodejs/node@3e4af49

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/internet
    • test-dns-lookup.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/internet/test-dns-lookup.js‎

Copy file name to clipboardExpand all lines: test/internet/test-dns-lookup.js
+17-1Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
'use strict';
22

33
require('../common');
4-
const dnsPromises = require('dns').promises;
4+
const common = require('../common');
5+
const dns = require('dns');
6+
const dnsPromises = dns.promises;
57
const { addresses } = require('../common/internet');
68
const assert = require('assert');
79

@@ -28,3 +30,17 @@ assert.rejects(
2830
message: `getaddrinfo ENOTFOUND ${addresses.INVALID_HOST}`
2931
}
3032
);
33+
34+
dns.lookup(addresses.INVALID_HOST, {
35+
hints: 0,
36+
family: 0,
37+
all: true
38+
}, common.mustCall((error) => {
39+
assert.strictEqual(error.code, 'ENOTFOUND');
40+
assert.strictEqual(
41+
error.message,
42+
`getaddrinfo ENOTFOUND ${addresses.INVALID_HOST}`
43+
);
44+
assert.strictEqual(error.syscall, 'getaddrinfo');
45+
assert.strictEqual(error.hostname, addresses.INVALID_HOST);
46+
}));

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.