You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed an issue with the deepEqualExcluding function.
Deeply nested date objects are not compared properly.
Here is my test case, with all tests should be failing :
import{assert,use}from'chai';importchaiExcludefrom'chai-exclude';use(chaiExclude);describe('deepEqualExcludingEvery',()=>{consttoday=newDate();constoldDay=newDate('1970-01-01T00:00:00.000Z');it('should compare two objects',()=>{assert.deepEqualExcluding({date: today},{date: oldDay},[]);});it('should compare two arrays of objects without props',()=>{assert.deepEqualExcludingEvery([{date: today}],[{date: oldDay}]);});it('should compare two arrays of objects',()=>{assert.deepEqualExcludingEvery([{date: today}],[{date: oldDay}],[]);});});
Upon further inspection, I noticed this :
In file chai-exclude.js, on ligne 203, this._obj value is [{ date: {} }]
But even then, how comes line 152 - new Assertion(actual, message).excludingEvery(props).to.deep.equal(expected) is validating this comparison ?
Is that the intended behavior ?
Node version is 20.15.1
Packages are :
"chai": "5.1.1",
"chai-exclude": "3.0.0",
Best regards,
Thomas
The text was updated successfully, but these errors were encountered:
Hey !
I noticed an issue with the
deepEqualExcluding
function.Deeply nested date objects are not compared properly.
Here is my test case, with all tests should be failing :
Upon further inspection, I noticed this :
In file
chai-exclude.js
, on ligne203
,this._obj
value is[{ date: {} }]
But even then, how comes line
152 - new Assertion(actual, message).excludingEvery(props).to.deep.equal(expected)
is validating this comparison ?Is that the intended behavior ?
Node version is
20.15.1
Packages are :
Best regards,
Thomas
The text was updated successfully, but these errors were encountered: