test: use expectsError in test-debug-agent.js

Use common.expectsError() in place of inline validation function in
test-debug-agent.js.

PR-URL: https://github.com/nodejs/node/pull/11410
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Arseniy Maximov authored and Michaël Zasso committed 2017-02-18 16:18:57 +01:00
1 parent 48f8869685
commit ca37ec084a
1 file changed
+6 -5
+6 -5
View File
@@ -1,12 +1,13 @@
'use strict';
require('../common');
const common = require('../common');
const assert = require('assert');
const debug = require('_debug_agent');
assert.throws(
() => { debug.start(); },
function(err) {
return (err instanceof assert.AssertionError &&
err.message === 'Debugger agent running without bindings!');
}
common.expectsError(
undefined,
assert.AssertionError,
'Debugger agent running without bindings!'
)
);