diff --git a/test/parallel/test-debug-agent.js b/test/parallel/test-debug-agent.js index d65029e5855b26..d2f57a0bf80550 100644 --- a/test/parallel/test-debug-agent.js +++ b/test/parallel/test-debug-agent.js @@ -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!' + ) );