From 2f66d7acaea10c909cda70579dc9152479720373 Mon Sep 17 00:00:00 2001 From: larissayvette Date: Wed, 12 Oct 2016 16:53:02 +0100 Subject: [PATCH 1/4] test: checking if error constructor is assert.AssertionError --- test/parallel/test-debug-agent.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-debug-agent.js b/test/parallel/test-debug-agent.js index 0bb5d7f9be25df..a301fec0e6b3ca 100644 --- a/test/parallel/test-debug-agent.js +++ b/test/parallel/test-debug-agent.js @@ -1,6 +1,12 @@ 'use strict'; require('../common'); const assert = require('assert'); +const debug = require('_debug_agent'); -assert.throws(() => { require('_debug_agent').start(); }, - assert.AssertionError); +assert.throws( + () => { debug.start();}, + function(err) { + return (err instanceof assert.AssertionError); + }, + 'Unexpected Error' +); From f5dd2945de48a8d480734e52f5a380b22d29a6ae Mon Sep 17 00:00:00 2001 From: larissayvette Date: Fri, 14 Oct 2016 07:45:20 +0100 Subject: [PATCH 2/4] test: checking if error constructor is assert.AssertionError --- test/parallel/test-debug-agent.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-debug-agent.js b/test/parallel/test-debug-agent.js index a301fec0e6b3ca..91cc9327df4245 100644 --- a/test/parallel/test-debug-agent.js +++ b/test/parallel/test-debug-agent.js @@ -5,8 +5,9 @@ const debug = require('_debug_agent'); assert.throws( () => { debug.start();}, - function(err) { - return (err instanceof assert.AssertionError); - }, - 'Unexpected Error' + function(err) { + if ((err instanceof assert.AssertionError) && /value/.test(err)) { + return true; + } + } ); From ee29c7a65c050e76543a875ef25adfa1d6462e0a Mon Sep 17 00:00:00 2001 From: larissayvette Date: Sat, 15 Oct 2016 08:56:03 +0100 Subject: [PATCH 3/4] test: checking whether error constructor is assert.AssertionError --- test/parallel/test-debug-agent.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-debug-agent.js b/test/parallel/test-debug-agent.js index 91cc9327df4245..5cee347275df61 100644 --- a/test/parallel/test-debug-agent.js +++ b/test/parallel/test-debug-agent.js @@ -6,8 +6,7 @@ const debug = require('_debug_agent'); assert.throws( () => { debug.start();}, function(err) { - if ((err instanceof assert.AssertionError) && /value/.test(err)) { - return true; - } + return (err instanceof assert.AssertionError && + err.message === 'Debugger agent running without bindings!'); } ); From 92550d1b2d1fe6b45e1f0a85ccd421bc5fc3db58 Mon Sep 17 00:00:00 2001 From: larissayvette Date: Mon, 17 Oct 2016 08:53:49 +0100 Subject: [PATCH 4/4] nits: identations --- test/parallel/test-debug-agent.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-debug-agent.js b/test/parallel/test-debug-agent.js index 5cee347275df61..95e1448633d085 100644 --- a/test/parallel/test-debug-agent.js +++ b/test/parallel/test-debug-agent.js @@ -4,9 +4,9 @@ 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!'); - } + () => { debug.start(); }, + function(err) { + return (err instanceof assert.AssertionError && + err.message === 'Debugger agent running without bindings!'); + } );