From ca37ec084a59ab20ab19882b77033bebf85ae555 Mon Sep 17 00:00:00 2001 From: Arseniy Maximov Date: Thu, 16 Feb 2017 03:35:34 +0300 Subject: [PATCH] test: use expectsError in test-debug-agent.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Colin Ihrig Reviewed-By: Michaƫl Zasso --- test/parallel/test-debug-agent.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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!' + ) );