Skip to content

Commit

Permalink
fixup! dns: runtime deprecate type coercion of dns.lookup options
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Aug 17, 2021
1 parent 4528834 commit 4dee2c4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2793,7 +2793,7 @@ changes:
pr-url: https://github.com/nodejs/node/pull/38906
description: Documentation-only deprecation.
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/00000
pr-url: https://github.com/nodejs/node/pull/39793
description: Runtime deprecation.
-->

Expand Down
15 changes: 15 additions & 0 deletions test/internet/test-dns-lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,18 @@ dns.lookup(addresses.NOT_FOUND, {
assert.strictEqual(error.syscall, 'getaddrinfo');
assert.strictEqual(error.hostname, addresses.NOT_FOUND);
}));

common.expectWarning('DeprecationWarning',
'Type coercion of dns.lookup options is deprecated',
'DEP0153');

assert.rejects(
dnsPromises.lookup(addresses.NOT_FOUND, {
family: 'IPv4',
all: 'all'
}),
{
code: 'ENOTFOUND',
message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`
}
);

0 comments on commit 4dee2c4

Please sign in to comment.