test: checking if error constructor is assert.AssertionError

PR-URL: https://github.com/nodejs/node/pull/9119
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
larissayvette authored and Myles Borins committed 2016-11-15 13:25:14 -05:00
1 parent 6f780893eb
commit 02f7e3aca3
1 file changed
+8 -2
+8 -2
View File
@@ -1,6 +1,12 @@
'use strict';
require('../common');
const assert = require('assert');
const debug = require('_debug_agent');
assert.throws(() => { require('_debug_agent').start(); },
assert.AssertionError);
assert.throws(
() => { debug.start(); },
function(err) {
return (err instanceof assert.AssertionError &&
err.message === 'Debugger agent running without bindings!');
}
);