-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dns: fix getServers return undefined
- Loading branch information
Jiahao Si
committed
Jul 21, 2022
1 parent
7a92662
commit d14d75b
Showing
2 changed files
with
13 additions
and
2 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
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,11 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
|
||
const { Resolver } = require('dns'); | ||
|
||
const resolver = new Resolver(); | ||
assert(resolver.getServers().length > 0); | ||
// Return undefined | ||
resolver._handle.getServers = common.mustCall(() => {}); | ||
assert.deepStrictEqual(resolver.getServers().length, 0); |