From 8c5aa214ec1e32844fb76009f78827a8b4ab3ca4 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Fri, 27 Jan 2017 15:09:36 -0500 Subject: [PATCH] test-console: streamline arrow fn and refine regex removed unneccessary curly braces and return statement from inspect arrow function updated `assert.throws` regex to look for exact match at start of string --- test/parallel/test-console.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index 0eb7924cb6cbdc..7bf1a5215f89e8 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -22,7 +22,7 @@ assert.doesNotThrow(function() { }); // an Object with a custom .inspect() function -const custom_inspect = { foo: 'bar', inspect: () => { return 'inspect'; } }; +const custom_inspect = { foo: 'bar', inspect: () => 'inspect' }; const stdout_write = global.process.stdout.write; const stderr_write = global.process.stderr.write; @@ -130,7 +130,7 @@ assert.strictEqual(errStrings.length, 0); assert.throws(() => { console.assert(false, 'should throw'); -}, /should throw/); +}, /^AssertionError: should throw$/); assert.doesNotThrow(() => { console.assert(true, 'this should not throw');