Skip to content

Commit

Permalink
test: add assert.notDeepStrictEqual() tests
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trott authored and MylesBorins committed Oct 26, 2016
1 parent 57c98f1 commit 1c81c07
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,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/));
Expand Down

0 comments on commit 1c81c07

Please sign in to comment.