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: not.to.include erroneously transformed to toEqual(expect.arrayContaining...) #227

Closed
seansfkelley opened this issue Aug 12, 2021 · 2 comments

Comments

@seansfkelley
Copy link
Contributor

The Chai codemod seems to be sensitive to not ordering in some cases. Assertions of the form

expect(array).not.to.contain(member);

are incorrectly inverted to

expect(array).toEqual(expect.arrayContaining([member]));

While

expect(array).to.not.contain(member);

results in the expected

expect(array).toEqual(expect.not.arrayContaining([member]));
@skovhus
Copy link
Owner

skovhus commented Aug 12, 2021

Thanks for reporting. Let us know if you want to create a PR fixing this. :)

@danbeam
Copy link
Contributor

danbeam commented Aug 8, 2022

@seansfkelley @skovhus i believe this was addressed in #244

@skovhus skovhus closed this as completed Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants