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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • 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.