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

fix: toBe/toEqual/toMatchObject expect compatability #607

Merged
merged 8 commits into from Jan 23, 2022

Conversation

sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Jan 22, 2022

This PR does a few things:

  • Fixes expect.any and toMatchObject are not working as expected #598
  • Uses the same algorithm for toBe, toMatchObject and toEqual that jest uses
  • Removes assymetric support for chai equality - this removes ambiguity. Example: when you have an assymetric mathcher in toEqual and THE SAME object, but without assymetric matcher, in another toEqual, the test might fail for one, but not for the other because we call different equality functions for each one
  • Rename asymmetricEquals to jestEquals to better represent what it is

@netlify
Copy link

netlify bot commented Jan 22, 2022

✔️ Deploy Preview for vitest-dev ready!

🔨 Explore the source changes: 60621e5

🔍 Inspect the deploy log: https://app.netlify.com/sites/vitest-dev/deploys/61ecf5393b8a7200087b1667

😎 Browse the preview: https://deploy-preview-607--vitest-dev.netlify.app

Copy link
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can merge it when conflicts get resolved

@sheremet-va sheremet-va merged commit 75113c7 into main Jan 23, 2022
@sheremet-va sheremet-va deleted the sheremet-va/jest-expect branch January 23, 2022 06:34
chaii3 pushed a commit to chaii3/vitest that referenced this pull request May 13, 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

Successfully merging this pull request may close these issues.

expect.any and toMatchObject are not working as expected
2 participants