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: check arg type for dnsPromises.resolve · nodejs/node@9d85a05

File tree

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

‎test/parallel/test-dns.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-dns.js
+25-8Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,31 @@ assert.deepStrictEqual(dns.getServers(), portsExpected);
135135
dns.setServers([]);
136136
assert.deepStrictEqual(dns.getServers(), []);
137137

138-
common.expectsError(() => {
139-
dns.resolve('example.com', [], common.mustNotCall());
140-
}, {
141-
code: 'ERR_INVALID_ARG_TYPE',
142-
type: TypeError,
143-
message: 'The "rrtype" argument must be of type string. ' +
144-
'Received type object'
145-
});
138+
{
139+
const errObj = {
140+
code: 'ERR_INVALID_ARG_TYPE',
141+
type: TypeError,
142+
message: 'The "rrtype" argument must be of type string. ' +
143+
'Received type object'
144+
};
145+
common.expectsError(() => {
146+
dns.resolve('example.com', [], common.mustNotCall());
147+
}, errObj);
148+
common.expectsError(() => {
149+
dnsPromises.resolve('example.com', []);
150+
}, errObj);
151+
}
152+
{
153+
const errObj = {
154+
code: 'ERR_INVALID_ARG_TYPE',
155+
type: TypeError,
156+
message: 'The "name" argument must be of type string. ' +
157+
'Received type undefined'
158+
};
159+
common.expectsError(() => {
160+
dnsPromises.resolve();
161+
}, errObj);
162+
}
146163

147164
// dns.lookup should accept only falsey and string values
148165
{

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.