Files
node/test/es-module/test-esm-dns-promises.mjs
Antoine du Hamel 987740399d tools: enforce trailing commas in test/es-module
PR-URL: https://github.com/nodejs/node/pull/60891
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-12-03 14:18:40 +01:00

15 lines
371 B
JavaScript

// Flags: --expose-internals
import '../common/index.mjs';
import assert from 'assert';
import { lookupService } from 'dns/promises';
const invalidAddress = 'fasdfdsaf';
assert.throws(() => {
lookupService(invalidAddress, 0);
}, {
code: 'ERR_INVALID_ARG_VALUE',
name: 'TypeError',
message: `The argument 'address' is invalid. Received '${invalidAddress}'`,
});