Skip to content

Commit 1c81c07

Browse files
TrottMylesBorins
authored andcommitted
test: add assert.notDeepStrictEqual() tests
There is no test coverage for `assert.notDeepStrictEqual()`. Add some minimal tests. PR-URL: #8177 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 57c98f1 commit 1c81c07

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

test/parallel/test-assert.js

+20-7
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,27 @@ assert.doesNotThrow(makeBlock(a.deepEqual, new Boolean(true), {}),
183183
assert.throws(makeBlock(a.deepEqual, {a: 1}, {b: 1}), a.AssertionError);
184184

185185
//deepStrictEqual
186-
assert.doesNotThrow(makeBlock(a.deepStrictEqual, new Date(2000, 3, 14),
187-
new Date(2000, 3, 14)),
188-
'deepStrictEqual(new Date(2000, 3, 14),\
189-
new Date(2000, 3, 14))');
186+
assert.doesNotThrow(
187+
makeBlock(a.deepStrictEqual, new Date(2000, 3, 14), new Date(2000, 3, 14)),
188+
'deepStrictEqual(new Date(2000, 3, 14), new Date(2000, 3, 14))'
189+
);
190190

191-
assert.throws(makeBlock(a.deepStrictEqual, new Date(), new Date(2000, 3, 14)),
192-
a.AssertionError,
193-
'deepStrictEqual(new Date(), new Date(2000, 3, 14))');
191+
assert.throws(
192+
makeBlock(a.deepStrictEqual, new Date(), new Date(2000, 3, 14)),
193+
a.AssertionError,
194+
'deepStrictEqual(new Date(), new Date(2000, 3, 14))'
195+
);
196+
197+
assert.throws(
198+
makeBlock(a.notDeepStrictEqual, new Date(2000, 3, 14), new Date(2000, 3, 14)),
199+
a.AssertionError,
200+
'notDeepStrictEqual(new Date(2000, 3, 14), new Date(2000, 3, 14))'
201+
);
202+
203+
assert.doesNotThrow(
204+
makeBlock(a.notDeepStrictEqual, new Date(), new Date(2000, 3, 14)),
205+
'notDeepStrictEqual(new Date(), new Date(2000, 3, 14))'
206+
);
194207

195208
// 7.3 - strict
196209
assert.doesNotThrow(makeBlock(a.deepStrictEqual, /a/, /a/));

0 commit comments

Comments
 (0)