diff options
author | John Maguire <jonnie.maguire@gmail.com> | 2017-01-27 15:09:36 -0500 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-01-30 10:22:28 -0800 |
commit | ca3d131bd42afa0c68be6aeb27623d53eae547a1 (patch) | |
tree | 71808232a1913cec79bd6e2d847ad92f377a053b | |
parent | 78545039d65fa24841454f161c3711ce4b5226bc (diff) | |
download | android-node-v8-ca3d131bd42afa0c68be6aeb27623d53eae547a1.tar.gz android-node-v8-ca3d131bd42afa0c68be6aeb27623d53eae547a1.tar.bz2 android-node-v8-ca3d131bd42afa0c68be6aeb27623d53eae547a1.zip |
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
PR-URL: https://github.com/nodejs/node/pull/11039
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r-- | test/parallel/test-console.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index 0eb7924cb6..7bf1a5215f 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'); |