From 181324e192aa75e923c918af84d9902de4ee3b24 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 18 Aug 2016 17:04:07 -0700 Subject: [PATCH] test: add assert.notDeepStrictEqual() tests There is no test coverage for `assert.notDeepStrictEqual()`. Add some minimal tests. PR-URL: https://github.com/nodejs/node/pull/8177 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- test/parallel/test-assert.js | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 9bb466f2f94421..97242363b4fb05 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -184,14 +184,27 @@ assert.doesNotThrow(makeBlock(a.deepEqual, new Boolean(true), {}), assert.throws(makeBlock(a.deepEqual, {a: 1}, {b: 1}), a.AssertionError); //deepStrictEqual -assert.doesNotThrow(makeBlock(a.deepStrictEqual, new Date(2000, 3, 14), - new Date(2000, 3, 14)), - 'deepStrictEqual(new Date(2000, 3, 14),\ - new Date(2000, 3, 14))'); +assert.doesNotThrow( + makeBlock(a.deepStrictEqual, new Date(2000, 3, 14), new Date(2000, 3, 14)), + 'deepStrictEqual(new Date(2000, 3, 14), new Date(2000, 3, 14))' +); -assert.throws(makeBlock(a.deepStrictEqual, new Date(), new Date(2000, 3, 14)), - a.AssertionError, - 'deepStrictEqual(new Date(), new Date(2000, 3, 14))'); +assert.throws( + makeBlock(a.deepStrictEqual, new Date(), new Date(2000, 3, 14)), + a.AssertionError, + 'deepStrictEqual(new Date(), new Date(2000, 3, 14))' +); + +assert.throws( + makeBlock(a.notDeepStrictEqual, new Date(2000, 3, 14), new Date(2000, 3, 14)), + a.AssertionError, + 'notDeepStrictEqual(new Date(2000, 3, 14), new Date(2000, 3, 14))' +); + +assert.doesNotThrow( + makeBlock(a.notDeepStrictEqual, new Date(), new Date(2000, 3, 14)), + 'notDeepStrictEqual(new Date(), new Date(2000, 3, 14))' +); // 7.3 - strict assert.doesNotThrow(makeBlock(a.deepStrictEqual, /a/, /a/));