Skip to content

Commit

Permalink
assert: fix deepStrictEqual on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
geeksilva97 committed Oct 16, 2024
1 parent 73414f3 commit 4c72dda
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/parallel/test-assert-deep.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,12 @@ test('Handle different error messages', () => {
assertNotDeepOrStrict(err1, {}, AssertionError);
});

test.only('Handle error causes', () => {
// This should fail as in assert.notEqual(1, 1) (?)
assert.notEqual(new Error("a"), new Error("b", { cause: new Error("y") }));
assert.deepStrictEqual(new Error("a"), new Error("a", { cause: new Error("y") }))
});

test('Handle NaN', () => {
assertDeepAndStrictEqual(NaN, NaN);
assertDeepAndStrictEqual({ a: NaN }, { a: NaN });
Expand Down

0 comments on commit 4c72dda

Please sign in to comment.