-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: move test that depends on dns query to internet
These test cases in `test/parallel/test-dns-lookup.js` send dns requests and depend on the results, which could fail if the DNS service for invalid hosts is hijacked by the ISP. PR-URL: #22516 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
- Loading branch information
1 parent
4862ce1
commit 6737201
Showing
2 changed files
with
30 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
const dnsPromises = require('dns').promises; | ||
const { addresses } = require('../common/internet'); | ||
const assert = require('assert'); | ||
|
||
assert.rejects( | ||
dnsPromises.lookup(addresses.INVALID_HOST, { | ||
hints: 0, | ||
family: 0, | ||
all: false | ||
}), | ||
{ | ||
code: 'ENOTFOUND', | ||
message: `getaddrinfo ENOTFOUND ${addresses.INVALID_HOST}` | ||
} | ||
); | ||
|
||
assert.rejects( | ||
dnsPromises.lookup(addresses.INVALID_HOST, { | ||
hints: 0, | ||
family: 0, | ||
all: true | ||
}), | ||
{ | ||
code: 'ENOTFOUND', | ||
message: `getaddrinfo ENOTFOUND ${addresses.INVALID_HOST}` | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters