Skip to content

Commit a6667d6

Browse files
addaleaxMylesBorins
authored andcommitted
test: slightly improve test-util-inspect assertions
PR-URL: #20721 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6f4e9ff commit a6667d6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,8 @@ util.inspect(process);
13741374
expect='WeakMap { [ [length]: 0 ] => {}, ... more items, extra: true }';
13751375
constexpectAlt='WeakMap { {} => [ [length]: 0 ], ... more items, '+
13761376
'extra: true }';
1377-
assert(out===expect||out===expectAlt);
1377+
assert(out===expect||out===expectAlt,
1378+
`Found "${out}" rather than "${expect}" or "${expectAlt}"`);
13781379
}
13791380

13801381
{// Test WeakSet
@@ -1397,7 +1398,8 @@ util.inspect(process);
13971398
expect='WeakSet { {}, ... more items, extra: true }';
13981399
constexpectAlt='WeakSet { [ 1, [length]: 1 ], ... more items, '+
13991400
'extra: true }';
1400-
assert(out===expect||out===expectAlt);
1401+
assert(out===expect||out===expectAlt,
1402+
`Found "${out}" rather than "${expect}" or "${expectAlt}"`);
14011403
}
14021404

14031405
{// Test argument objects.

0 commit comments

Comments
 (0)