Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chai's to.deep.have.members is converted to toEqual which is wrong #124

Open
deser opened this issue Aug 2, 2018 · 4 comments
Open

Chai's to.deep.have.members is converted to toEqual which is wrong #124

deser opened this issue Aug 2, 2018 · 4 comments
Labels

Comments

@deser
Copy link

deser commented Aug 2, 2018

I have found correct method for that in jest-extended - toIncludeAllMembers.

@skovhus
Copy link
Owner

skovhus commented Aug 2, 2018

Thanks for reporting this. Are you up for creating a PR for this? We don't want to depend on jest-extended though.

@deser
Copy link
Author

deser commented Aug 2, 2018

Not sure I see alternative to toIncludeAllMembers

@skovhus
Copy link
Owner

skovhus commented Sep 18, 2018

So I just checked and we convert:

- expect([{ id: 1 }]).to.deep.include.members([{ id: 1 }]);
+ expect([{ id: 1 }]).toEqual(expect.arrayContaining([{ id: 1 }]));

That seems to be correct. Can you report which case this didn't work for you @deser

@deser
Copy link
Author

deser commented Sep 19, 2018

As far as I remember it was just toEqual without expect.arrayContaining. However I'm not sure that to.deep.include.members is covered by toEqual(expect.arrayContaining, you can check what's inside toIncludeAllMembers I just don't have time to cover all cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants