Skip to content

Commit

Permalink
test: complete coverage for lib/assert.js
Browse files Browse the repository at this point in the history
6481c93 modified `lib/assert.js` and added some tests for new
functionality, but left a single line uncovered by tests. This adds a
test that covers the currently-uncovered line (which is the final
`return` statement in `setHasSimilarElement()`).`

PR-URL: #12239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott committed Apr 7, 2017
1 parent c6e0ba3 commit 971fe67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parallel/test-assert-deep.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ for (const a of similar) {
}
}

assert.throws(
() => { assert.deepEqual(new Set([{a: 0}]), new Set([{a: 1}])); },
/^AssertionError: Set { { a: 0 } } deepEqual Set { { a: 1 } }$/
);

function assertDeepAndStrictEqual(a, b) {
assert.deepEqual(a, b);
assert.deepStrictEqual(a, b);
Expand Down

0 comments on commit 971fe67

Please sign in to comment.