Skip to content

Commit a6f8379

Browse files
Trottevanlucas
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 <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 29a7196 commit a6f8379

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

test/parallel/test-assert.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,27 @@ assert.doesNotThrow(makeBlock(a.deepEqual, new Boolean(true), {}),
184184
assert.throws(makeBlock(a.deepEqual, {a: 1}, {b: 1}), a.AssertionError);
185185

186186
//deepStrictEqual
187-
assert.doesNotThrow(makeBlock(a.deepStrictEqual, new Date(2000, 3, 14),
188-
new Date(2000, 3, 14)),
189-
'deepStrictEqual(new Date(2000, 3, 14),\
190-
new Date(2000, 3, 14))');
187+
assert.doesNotThrow(
188+
makeBlock(a.deepStrictEqual, new Date(2000, 3, 14), new Date(2000, 3, 14)),
189+
'deepStrictEqual(new Date(2000, 3, 14), new Date(2000, 3, 14))'
190+
);
191191

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

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

0 commit comments

Comments
 (0)