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:
parent
48f8869685
commit
ca37ec084a
@ -1,12 +1,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const debug = require('_debug_agent');
|
const debug = require('_debug_agent');
|
||||||
|
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => { debug.start(); },
|
() => { debug.start(); },
|
||||||
function(err) {
|
common.expectsError(
|
||||||
return (err instanceof assert.AssertionError &&
|
undefined,
|
||||||
err.message === 'Debugger agent running without bindings!');
|
assert.AssertionError,
|
||||||
}
|
'Debugger agent running without bindings!'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user