Skip to content

Commit c6af766

Browse files
jonniedarkoevanlucas
authored andcommitted
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: #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]>
1 parent e367b74 commit c6af766

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-console.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ assert.doesNotThrow(function() {
2222
});
2323

2424
// an Object with a custom .inspect() function
25-
const custom_inspect = { foo: 'bar', inspect: () => { return 'inspect'; } };
25+
const custom_inspect = { foo: 'bar', inspect: () => 'inspect' };
2626

2727
const stdout_write = global.process.stdout.write;
2828
const stderr_write = global.process.stderr.write;
@@ -130,7 +130,7 @@ assert.strictEqual(errStrings.length, 0);
130130

131131
assert.throws(() => {
132132
console.assert(false, 'should throw');
133-
}, /should throw/);
133+
}, /^AssertionError: should throw$/);
134134

135135
assert.doesNotThrow(() => {
136136
console.assert(true, 'this should not throw');

0 commit comments

Comments
 (0)