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
The test will fail, but it should pass. The spec says that the passed node should be checked against "inclusive descendants". The "inclusive" part means that it should include the object (the parent node) itself when comparing.
This fix has been included in the v2.12.0 release. I'm going to close this issue, however if the problem reappears, please feel free to open a new issue!
Prerequisites
Stencil Version
2.10.0
Current Behavior
In unit tests,
myNode.contains(myNode)
is returningfalse
.Expected Behavior
myNode.contains(myNode)
should returntrue
.Steps to Reproduce
Create a simple unit test like this:
The test will fail, but it should pass. The spec says that the passed node should be checked against "inclusive descendants". The "inclusive" part means that it should include the object (the parent node) itself when comparing.
You can see the correct behavior in the console:

Code Reproduction URL
https://codesandbox.io/s/stencil-mock-node-contains-test-kcwn2?file=/src/nodeContains.spec.ts
Additional Information
I can probably submit a PR for this shortly. I don't see any tests for the mock
Node
implementation, by the way, or I would update the test.The text was updated successfully, but these errors were encountered: