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
This happens because "should" value (the actual value) is obtained using the valueOf() function (should.js line 81) and the "equal" function does not follow the same approach, comparing the valufOf(actual) with the actual object directly (should.js line 303). In case of date objects since valueOf returns a number the equality fails.
I fix it by performing the same process of value comparison changing the equal function to (line 303):
Object(val).valueOf()===this.obj
Not sure if this has broader implication on the framework thou.
Cheers,
Eric
The text was updated successfully, but these errors were encountered:
Hi guys,
Using should.equal with Date objects seems to be failing.
This happens because "should" value (the actual value) is obtained using the valueOf() function (should.js line 81) and the "equal" function does not follow the same approach, comparing the valufOf(actual) with the actual object directly (should.js line 303). In case of date objects since valueOf returns a number the equality fails.
I fix it by performing the same process of value comparison changing the equal function to (line 303):
Not sure if this has broader implication on the framework thou.
Cheers,
Eric
The text was updated successfully, but these errors were encountered: