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
Proxy-related frames are showing up in the stack trace for the .include assertion when testing for a subset of properties in an object. Also, custom error messages aren't being displayed in this case.
AssertionError: expected { x: { a: 1 } } to have property 'x' of { x: 9 }, but got { a: 1 }
+ expected - actual
{
- "a": 1
+ "x": 9
}
at Proxy.<anonymous> (node_modules/chai/lib/chai/core/assertions.js:322:25)
at Array.forEach (native)
at Proxy.include (node_modules/chai/lib/chai/core/assertions.js:317:13)
at Proxy.chainableMethodWrapper (node_modules/chai/lib/chai/utils/addChainableMethod.js:93:49)
at Context.<anonymous> (test/index.js:8:26)
I suspect both problems are a lack of flags being transferred to the .property assertion that the .include assertion calls internally. Will investigate later, just noting for now.
The text was updated successfully, but these errors were encountered:
Just realized this problem is much more widespread than .include, and predates the proxy stuff. Basically, any assertion that creates another assertion internally isn't going to filter out Chai's implementation frames correctly. This happens to be the exact same root problem as described here regarding the assert interface, so an ideal solution would fix that occurrence of the problem too.
I think expanding the usage of the already existing keep_ssfi flag will do the trick. Working on a PR.
Also, most assertions aren't always passing along a user's custom error message either, but this isn't exactly the same problem. Will solve separately.
Proxy-related frames are showing up in the stack trace for the
.include
assertion when testing for a subset of properties in an object. Also, custom error messages aren't being displayed in this case.Example:
Output:
I suspect both problems are a lack of flags being transferred to the
.property
assertion that the.include
assertion calls internally. Will investigate later, just noting for now.The text was updated successfully, but these errors were encountered: