Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
dns: fix getServers return undefined
PR-URL: #43922 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
- Loading branch information
1 parent
7c75539
commit 67b4edde37d84203f6a1e6e4531fe7c9ae294134
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.strictEqual(resolver.getServers().length, 0); |