Skip to content

Commit 533e565

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 <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
1 parent 7e98f23 commit 533e565

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/parallel/test-util-inspect.js

+2
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)