| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7794d4e commit ae016c8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const common = require('../common'); | |
| 3 | + const { addresses } = require('../common/internet'); | ||
| 3 | 4 | const assert = require('assert'); | |
| 4 | 5 | const cares = process.binding('cares_wrap'); | |
| 5 | 6 | const dns = require('dns'); | |
@@ -92,6 +93,30 @@ common.expectsError(() => { | |||
| 92 | 93 | all: false | |
| 93 | 94 | }); | |
| 94 | 95 | assert.deepStrictEqual(res, { address: '127.0.0.1', family: 4 }); | |
| 96 | + | ||
| 97 | + assert.rejects( | ||
| 98 | + dnsPromises.lookup(addresses.INVALID_HOST, { | ||
| 99 | + hints: 0, | ||
| 100 | + family: 0, | ||
| 101 | + all: false | ||
| 102 | + }), | ||
| 103 | + { | ||
| 104 | + code: 'ENOTFOUND', | ||
| 105 | + message: `getaddrinfo ENOTFOUND ${addresses.INVALID_HOST}` | ||
| 106 | + } | ||
| 107 | + ); | ||
| 108 | + | ||
| 109 | + assert.rejects( | ||
| 110 | + dnsPromises.lookup(addresses.INVALID_HOST, { | ||
| 111 | + hints: 0, | ||
| 112 | + family: 0, | ||
| 113 | + all: true | ||
| 114 | + }), | ||
| 115 | + { | ||
| 116 | + code: 'ENOTFOUND', | ||
| 117 | + message: `getaddrinfo ENOTFOUND ${addresses.INVALID_HOST}` | ||
| 118 | + } | ||
| 119 | + ); | ||
| 95 | 120 | })(); | |
| 96 | 121 | ||
| 97 | 122 | dns.lookup(false, { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments