- Version: v6.9.1
- Platform: OS X
- Subsystem: assert
assert.deepStrictEqual (and strictEqual) is fooled by the following code:
functionFakeDate(){};FakeDate.prototype=Date.prototype;constf=newFakeDate();constd=newDate();f.toString();//TypeError: Method Date.prototype.toString called on incompatible receiver [object Object]d.toString();//'Wed Dec 14 2016 09:53:28 GMT+1100 (AEDT)'assert.deepStrictEqual(d,f);// does not throw any errorI think it's reasonable to expect that assert.deepStrictEqual should consider d and f as unequal.
I have not tested on Node master, however there are no relevant changes in assert.js between 6.9.1 and master.
assert.deepStrictEqual(andstrictEqual) is fooled by the following code:I think it's reasonable to expect that
assert.deepStrictEqualshould considerdandfas unequal.I have not tested on Node master, however there are no relevant changes in
assert.jsbetween 6.9.1 and master.