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 2017-02-16 03:35:34 +03:00 committed by Michaël Zasso
parent 48f8869685
commit ca37ec084a

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!'
)
);