Skip to content

Commit

Permalink
test-console: streamline arrow fn and refine regex
Browse files Browse the repository at this point in the history
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: #11039
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
jonniedarko authored and evanlucas committed Jan 31, 2017
1 parent e367b74 commit c6af766
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down

1 comment on commit c6af766

@Fishrock123
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subsystem should have been test:

Please sign in to comment.