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
This is a known breaking change for 4.0.0. Take a look at the release notes which describe this:
You can now use the deep flag for the .include assertion in order to perform a deep equality check to see if something is included on the target.
Previously, .include was using strict equality (===) for non-negated property inclusion, but deep equality for negated property inclusion and array inclusion. This change causes the .include assertion to always use strict equality unless the deep flag is set.
Please take a look at this comment if you want to know more about it. (Related Issues: #743, PRs: #760, #761)
The solution is to add .deep to your assertion, so expect(items).to.include({ id: 1 }); becomes expect(items).to.deep.include({ id: 1 });.
I'll close this, as we're aware of the breaking change, and we've documented it. Let us know if you have any other issues with your migration 🙂
The following code fails with chai 4.1.2, but works fine with 3.5.0:
Node version: v8.4.0
Package versions:
The text was updated successfully, but these errors were encountered: