mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
be6de1a0c8
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>
11 lines
380 B
JavaScript
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$/);
|