0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-dns-regress-7070.js
Wallace Zhang be6de1a0c8 test: test error messages in test-dns-regress-7070
Add a RegExp as a second argument to assert.throws().

PR-URL: https://github.com/nodejs/node/pull/10058
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-12-23 17:18:48 -08:00

11 lines
380 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const dns = require('dns');
// Should not raise assertion error. Issue #7070
assert.throws(() => dns.resolveNs([]), // bad name
/^Error: "name" argument must be a string$/);
assert.throws(() => dns.resolveNs(''), // bad callback
/^Error: "callback" argument must be a function$/);