★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/c145690aadNouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files

test: improve test coverage for comparisons

PR-URL: #22212
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
BridgeAR authored and rvagg committed Aug 3, 2018
1 parent f1c22ea commit c145690aada7c55f3f1cc5a5c4213df743bfff36
Showing with 9 additions and 5 deletions.
  1. +9 −5 test/parallel/test-assert-deep.js
@@ -367,6 +367,7 @@ assertOnlyDeepEqual(
new Map([[null, undefined]]),
new Map([[undefined, null]])
);

assertOnlyDeepEqual(
new Set([null, '']),
new Set([undefined, 0])
@@ -375,6 +376,10 @@ assertNotDeepOrStrict(
new Set(['']),
new Set(['0'])
);
assertOnlyDeepEqual(
new Map([[1, {}]]),
new Map([[true, {}]])
);

// GH-6416. Make sure circular refs don't throw.
{
@@ -551,13 +556,12 @@ assertOnlyDeepEqual([1, , , 3], [1, , , 3, , , ]);
// Handle different error messages
{
const err1 = new Error('foo1');
const err2 = new Error('foo2');
const err3 = new TypeError('foo1');
assertNotDeepOrStrict(err1, err2, assert.AssertionError);
assertNotDeepOrStrict(err1, err3, assert.AssertionError);
assertNotDeepOrStrict(err1, new Error('foo2'), assert.AssertionError);
assertNotDeepOrStrict(err1, new TypeError('foo1'), assert.AssertionError);
assertDeepAndStrictEqual(err1, new Error('foo1'));
// TODO: evaluate if this should throw or not. The same applies for RegExp
// Date and any object that has the same keys but not the same prototype.
assertOnlyDeepEqual(err1, {}, assert.AssertionError);
assertOnlyDeepEqual(err1, {});
}

// Handle NaN

0 comments on commit c145690

Please sign in to comment.
You can’t perform that action at this time.