mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
31 lines
590 B
JavaScript
31 lines
590 B
JavaScript
|
'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}`
|
||
|
}
|
||
|
);
|