[Bug]: expect().toEqual does not compare unique node properties
Version
29.5.0
Steps to reproduce
it("tests the node's properties", () => {
const text1 = document.createTextNode("text");
text1.customProperty = "customProperty";
const text2 = document.createTextNode("text");
expect(text1).toEqual(text2); // Passed
});
Expected behavior
Test should fail since the text1 has a custom property.
Actual behavior
The expect().toEqual method can't detect the custom properties on the Node, same goes for the toStrictEqual.
Additional context
No response
Environment
System:
OS: Windows 11 10.0.22621
CPU: (12) x64 AMD Ryzen 5 5600 6-Core Processor
Binaries:
Node: 18.18.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
npmPackages:
jest: ^29.5.0 => 29.7.0
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.