Skip to content

Commit

Permalink
test: slightly improve test-util-inspect assertions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
addaleax authored and MylesBorins committed May 22, 2018
1 parent 6f4e9ff commit a6667d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/parallel/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,8 @@ util.inspect(process);
expect = 'WeakMap { [ [length]: 0 ] => {}, ... more items, extra: true }';
const expectAlt = 'WeakMap { {} => [ [length]: 0 ], ... more items, ' +
'extra: true }';
assert(out === expect || out === expectAlt);
assert(out === expect || out === expectAlt,
`Found "${out}" rather than "${expect}" or "${expectAlt}"`);
}

{ // Test WeakSet
Expand All @@ -1397,7 +1398,8 @@ util.inspect(process);
expect = 'WeakSet { {}, ... more items, extra: true }';
const expectAlt = 'WeakSet { [ 1, [length]: 1 ], ... more items, ' +
'extra: true }';
assert(out === expect || out === expectAlt);
assert(out === expect || out === expectAlt,
`Found "${out}" rather than "${expect}" or "${expectAlt}"`);
}

{ // Test argument objects.
Expand Down

0 comments on commit a6667d6

Please sign in to comment.