Skip to content

Commit 4dee2c4

Browse files
committed
fixup! dns: runtime deprecate type coercion of dns.lookup options
1 parent 4528834 commit 4dee2c4

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

doc/api/deprecations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2793,7 +2793,7 @@ changes:
27932793
pr-url: https://github.com/nodejs/node/pull/38906
27942794
description: Documentation-only deprecation.
27952795
- version: REPLACEME
2796-
pr-url: https://github.com/nodejs/node/pull/00000
2796+
pr-url: https://github.com/nodejs/node/pull/39793
27972797
description: Runtime deprecation.
27982798
-->
27992799

test/internet/test-dns-lookup.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,18 @@ dns.lookup(addresses.NOT_FOUND, {
4444
assert.strictEqual(error.syscall, 'getaddrinfo');
4545
assert.strictEqual(error.hostname, addresses.NOT_FOUND);
4646
}));
47+
48+
common.expectWarning('DeprecationWarning',
49+
'Type coercion of dns.lookup options is deprecated',
50+
'DEP0153');
51+
52+
assert.rejects(
53+
dnsPromises.lookup(addresses.NOT_FOUND, {
54+
family: 'IPv4',
55+
all: 'all'
56+
}),
57+
{
58+
code: 'ENOTFOUND',
59+
message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`
60+
}
61+
);

0 commit comments

Comments
 (0)