Skip to content

Commit 9162316

Browse 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

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/parallel/test-util-inspect.js

Lines 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)