From b17561898609508580b384a32865b106f41547f4 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 13 Dec 2018 07:33:31 +0100 Subject: [PATCH] assert: adjust loose assertions This changes the loose deep equal comparison by using the same logic as done in the strict deep equal comparison besides comparing primitives loosely and not comparing symbol properties. `assert.deepEqual` is still commenly used and this is likely the biggest pitfall. Most changes are only minor and won't have a big impact besides likely fixing user expectations. --- doc/api/assert.md | 47 ++++-- lib/internal/util/comparisons.js | 153 ++++++------------ test/es-module/test-esm-dynamic-import.js | 9 +- test/parallel/test-assert-checktag.js | 8 +- test/parallel/test-assert-deep.js | 50 +++--- .../test-assert-typedarray-deepequal.js | 10 +- 6 files changed, 116 insertions(+), 161 deletions(-) diff --git a/doc/api/assert.md b/doc/api/assert.md index 4c4b2c4250f581..1c1ef72967c704 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -163,6 +163,10 @@ An alias of [`assert.ok()`][].