Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9162316

Browse filesBrowse files
aqrlnMylesBorins
authored andcommitted
test: add arrow functions to test-util-inspect
Even though arrow functions and ES5 anonymous functions are technically the same for util.js, it won't hurt to test both. Backport-PR-URL: #11970 PR-URL: #11781 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
1 parent 1604848 commit 9162316
Copy full SHA for 9162316

File tree

Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-util-inspect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ assert.strictEqual(util.inspect(false), 'false');
99
assert.strictEqual(util.inspect(''), "''");
1010
assert.strictEqual(util.inspect('hello'), "'hello'");
1111
assert.strictEqual(util.inspect(function() {}), '[Function]');
12+
assert.strictEqual(util.inspect(() => {}), '[Function]');
1213
assert.strictEqual(util.inspect(undefined), 'undefined');
1314
assert.strictEqual(util.inspect(null), 'null');
1415
assert.strictEqual(util.inspect(/foo(bar\n)?/gi), '/foo(bar\\n)?/gi');
@@ -28,6 +29,7 @@ assert.strictEqual(util.inspect([1, [2, 3]]), '[ 1, [ 2, 3 ] ]');
2829
assert.strictEqual(util.inspect({}), '{}');
2930
assert.strictEqual(util.inspect({a: 1}), '{ a: 1 }');
3031
assert.strictEqual(util.inspect({a: function() {}}), '{ a: [Function: a] }');
32+
assert.strictEqual(util.inspect({a: () => {}}), '{ a: [Function: a] }');
3133
assert.strictEqual(util.inspect({a: 1, b: 2}), '{ a: 1, b: 2 }');
3234
assert.strictEqual(util.inspect({'a': {}}), '{ a: {} }');
3335
assert.strictEqual(util.inspect({'a': {'b': 2}}), '{ a: { b: 2 } }');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.