unexpected diff on assert.deepStrictEqual
Version
v20.5.0 (tried on node 16 and 21)
Platform
([ronment]::OSVersion.VersionString) x64
What steps will reproduce the bug?
require("assert").deepStrictEqual(
{
common: {},
key1: "",
creator: "123",
},
{
creator: "123",
},
);
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Only comon and key1 exist so
{
+ common: {},
+ key1: ''
}
What do you see instead?
{
+ common: {},
+ creator: '123',
+ key1: ''
- creator: '123'
}
Additional information
No response
It happened to me as well.
The current implementation for the diff is a quick best effort implementation and we have to change it to Myers algorithm or similar to properly detect these changes without a bad runtime.
Would a fix to this get added to node 20?
There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the https://github.com/nodejs/node/labels/never-stale label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document.
bump