I have reason to test eg. [ { valueOf: ()=>0 } ] to [ 0 ] and want that test to succeed.
Node assert, and Chai's various interfaces, all seem to automatically use strict equality when doing deep equality tests.
Is there an assert.deepEqual that will not do an assert.deepStrictEqual somewhere? A deep analog of assert.equal instead of assert.strictEqual ?
All right, developing insight: it can't be done generally.
deepEqual will compare "all own and inherited enumerable object properties", and it will ( I am assuming here ) recursively descend on object properties until it encounters primitive values.
It has no reason to stop after the first level ( the array ), when encountering the second level ( the object ). The fact that my data actually has the encoding at the Object level is specific to my use case, and can not be assumed for the general case.
When arriving at primitive values for properties, then equality can generally usefully be non-strict.
The fact that an Object has a valueOf property ( which may or may not even be enumerable ) does not mean it should be treated as a primitive instead of an Object. Lots of things have a valueOf property.
The difference between deepEqual and equal is that equal knows it should be comparing two primitives ( or references ), and deepEqual can never know.
I was assuming too much, and asking the wrong question. Sorry SO.